<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: ukhype83</title>
    <description>The latest articles on DEV Community by ukhype83 (@ukhype1983_a92e7968657284).</description>
    <link>https://dev.to/ukhype1983_a92e7968657284</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4126327%2F999f5a66-f2d9-4a4a-97ee-c80212e018a6.png</url>
      <title>DEV Community: ukhype83</title>
      <link>https://dev.to/ukhype1983_a92e7968657284</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/ukhype1983_a92e7968657284"/>
    <language>en</language>
    <item>
      <title>I built a fake 30-year company for a more realistic Postgres sample database</title>
      <dc:creator>ukhype83</dc:creator>
      <pubDate>Tue, 15 Sep 2026 13:29:46 +0000</pubDate>
      <link>https://dev.to/ukhype1983_a92e7968657284/i-built-a-fake-30-year-company-for-a-more-realistic-postgres-sample-database-2p9h</link>
      <guid>https://dev.to/ukhype1983_a92e7968657284/i-built-a-fake-30-year-company-for-a-more-realistic-postgres-sample-database-2p9h</guid>
      <description>&lt;p&gt;Every sample database has the same problem: it's either too small to be interesting or too abstract to stick in your head. pagila and Chinook are lovely, but you'll never stress a query planner with a few thousand rows. The StackOverflow dataset is genuinely great. But posts-and-votes only takes you so far, and I wanted data anyone could reason about on sight.&lt;/p&gt;

&lt;p&gt;So I did the sensible thing and invented an entire company.&lt;/p&gt;

&lt;h2&gt;
  
  
  Meet Nick's Gaming Emporium
&lt;/h2&gt;

&lt;p&gt;NGE is a fictional video-game retailer, simulated across its whole life, from &lt;strong&gt;1986 to 2016&lt;/strong&gt;. It opens in a strip mall, rides the dot-com wave, balloons through the console boom, and then does what most retailers eventually do: it dies. Founding, growth, decline, liquidation, the lot.&lt;/p&gt;

&lt;p&gt;The company is invented. The &lt;em&gt;catalogue&lt;/em&gt; isn't. The products are a real game-release list, so every title and release date is genuine. That one detail is what makes the sales data feel believable instead of random: you're not querying &lt;code&gt;product_47&lt;/code&gt;, you're querying games you've actually heard of, selling in the years they actually came out.&lt;/p&gt;

&lt;h2&gt;
  
  
  It's a generator, but you don't have to run it
&lt;/h2&gt;

&lt;p&gt;Under the hood NGE is a deterministic generator: same seed, same rows, every time. There's a matching SQL Server build from the same generator too, so the &lt;em&gt;same data&lt;/em&gt; exists on both engines if you ever fancy comparing planners across the two.&lt;/p&gt;

&lt;p&gt;Here's the part that matters on a Tuesday afternoon, though: &lt;strong&gt;you don't have to build anything.&lt;/strong&gt; Each size ships as a ready-to-restore dump you just download.&lt;/p&gt;

&lt;p&gt;Sizes, so you can match your hardware:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;tiny / small:&lt;/strong&gt; quick to restore on a laptop&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;medium:&lt;/strong&gt; a solid single-machine dataset&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;large:&lt;/strong&gt; ~3TB restored (a 260GB &lt;code&gt;pg_dump -Fc&lt;/code&gt;), for when you actually want to watch things fall over at scale&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What's in it
&lt;/h2&gt;

&lt;p&gt;It's not one big sales table. NGE is a whole system:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;OLTP:&lt;/strong&gt; shops, staff, customers, sales, trade-ins, refunds, multi-currency&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A data warehouse:&lt;/strong&gt; a proper star schema with dimensions, facts and rollups, plus a reporting layer&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;A web layer:&lt;/strong&gt; accounts, reviews, page views&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;So one dataset covers everything from "learn a JOIN" to "build a star-schema report" to "why on earth is this query spilling to disk."&lt;/p&gt;

&lt;h2&gt;
  
  
  Trying it (Postgres)
&lt;/h2&gt;

&lt;p&gt;Grab a dump from the repo's README links, then:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;createdb nge
pg_restore &lt;span class="nt"&gt;-j&lt;/span&gt; 4 &lt;span class="nt"&gt;-d&lt;/span&gt; nge nge_small.dump
psql &lt;span class="nt"&gt;-d&lt;/span&gt; nge &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s2"&gt;"ANALYZE;"&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Two things worth knowing. The dump carries no planner statistics, so run &lt;code&gt;ANALYZE&lt;/code&gt; after restoring or your query plans will be nonsense. And there's no hard-coded collation baked into the schema, so it restores cleanly on any locale. I checked, so you don't have to.&lt;/p&gt;

&lt;h2&gt;
  
  
  It's deliberately imperfect
&lt;/h2&gt;

&lt;p&gt;Worth being upfront about: the schema and indexing are &lt;strong&gt;not&lt;/strong&gt; a textbook-perfect reference design, and they're not trying to be. They're meant to feel like a real system that grew, got patched, and accreted 30 years of decisions, the kind of database you actually inherit rather than the one from the textbook. There's plenty to tune, question, or argue with, which is more or less the point.&lt;/p&gt;

&lt;h2&gt;
  
  
  And, unavoidably, some nonsense
&lt;/h2&gt;

&lt;p&gt;Because the company needed a reason to exist, it also got a backstory. There's a thoroughly ridiculous companion "documentary" fan-site, linked from the repo. Completely optional. But if your test data is going to have a founder, he may as well have a tragic third act.&lt;/p&gt;

&lt;h2&gt;
  
  
  Links
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Repo (downloads + restore steps):&lt;/strong&gt; &lt;a href="https://github.com/ukhype83-dev/nicks-gaming-emporium" rel="noopener noreferrer"&gt;https://github.com/ukhype83-dev/nicks-gaming-emporium&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's free and open source. If you use it, break it, or have ideas for it, I'd love the feedback. Issues and PRs welcome.&lt;/p&gt;

</description>
      <category>postgres</category>
      <category>sql</category>
      <category>database</category>
      <category>showdev</category>
    </item>
  </channel>
</rss>
