title: Maximum (usable) number of rows in a Postgresql table
body: <p>I realize that, per Pg docs (<a href="http://www.postgresql.org/about/" rel="noreferrer">http://www.postgresql.org/about/</a>), one can store an unlimited number of rows in a table. However, what is the "rule of thumb" for usable number of rows, if any?</p>
  
  <p>Background: I want to store daily readings for a couple of decades for 13 million cells. That works out to 13 M * (366|365) * 20 ~ 9.5e10, or 95 B rows (in reality, around 120 B rows).</p>
  
  <p>So, using table partitioning, I set up a master table, and then inherited tables by year. That divvies up the rows to ~ 5.2 B rows per table.</p>
  
  <p>Each row is 9 SMALLINTs, and two INTs, so, 26 bytes. Add to that, the Pg overhead of 23 bytes per row, and we get 49 bytes per row. So, each table, without any PK or any other index, will weigh in at ~ 0.25 TB.</p>
  
  <p>For starters, I have created only a subset of the above data, that is, only for about 250,000 cells. I have to do a bunch of tuning (create proper indexes, etc.), but the performance is really terrible right now. Besides, every time I need to add more data, I will have to drop the keys and the recreate them. The saving grace is that once everything is loaded, it will be a readonly database.</p>
  
  <p>Any suggestions? Any other strategy for partitioning?</p>