Get StackOverflow2013 Database for PostgreSQL & SQLServer

StackOverflow2013 database on PostgreSQL
Spread the love

Which is faster? PostgreSQL or SQL Server?

Well we can figure this out by running similar queries & workloads on a database with the same structure and data on both PostgreSQL & SQL Server.

For this purpose, I love StackOverflow2013 database copy. Neither too large, nor too small.

For SQL Server, you can download this database from BrentOzar’s blog post How to Download the Stack Overflow Database. This restores a 50 GB database on SQL Server.

Direct link to download a 10 GB zipped file of StackOverflow2013 from Brent’s website.

For PostgreSQL, you can download a plain-text compressed pg_dump backup of 8 GB from this link. This has a similar structure and the same data as the SQL Server copy. When restored, it is supposed to consume approximately 28 GB in PostgreSQL.

Assuming, downloaded file path /tmp/backups/stackoverflow2013.sql.gz. We can extract the compressed backup file, and restore data from it inside PostgreSQL using the following sample code –

Below is the row count of tables with stackoverflow2013 database on PostgreSQL –

I hope this will be helpful to all database enthusiasts out there trying to learn PostgreSQL & SQL Server.

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.