pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Large table or many small tables?
2+ messages / 2 participants
[nested] [flat]

* Large table or many small tables?
@ 2002-03-06 21:19  Joel Mc Graw <jmcgraw@databill.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Joel Mc Graw @ 2002-03-06 21:19 UTC (permalink / raw)
  To: pgsql-admin

Assuming that the data is exactly the same, I'm wondering if it is
better to store it in a single large table or many smaller tables. 
Right now I have upwards of 2000 tables, some containing upwards of
10,000 records, and each record contains a large amount of text stored
in a varchar field.


Problem Domain (for anyone that's interested):
--------------------------------
I receive data transfers from people; a table is created for each data
transfer.  Each data transfer has multiple text files.  The files are
parsed into pages, and each page is stored in the table just created. 
The number of transfers (and thereby the number of tables) is increasing
daily.

Thanks for any input.




------------------------------------------------------
Joel Mc Graw
DataBill, LLC
602-415-1234 ext. 13

-----BEGIN GEEK CODE BLOCK-----
Version: 3.1
GCS d-@ s: a C++++ UB++++ P-- L- E? W++ N w--- O? M+ V
PS+++ PE++ Y+ PGP++ t+ 5++ X tv+ b+ DI++ G e++ h---- r+++ y++++
-----END GEEK CODE BLOCK-----






^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Large table or many small tables?
@ 2002-03-07 04:33  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Joel Mc Graw <jmcgraw@databill.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2002-03-07 04:33 UTC (permalink / raw)
  To: jmcgraw@databill.com; +Cc: pgsql-admin

Joel Mc Graw <jmcgraw@databill.com> writes:
> Assuming that the data is exactly the same, I'm wondering if it is
> better to store it in a single large table or many smaller tables. 
> Right now I have upwards of 2000 tables, some containing upwards of
> 10,000 records, and each record contains a large amount of text stored
> in a varchar field.

10K records is in the range of "too small to notice".  On the other
hand, 2000 tables is probably more files than you want to be holding
open at once, on most Unixen.  You would be much better off with one
table having 20M records, I should think.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2002-03-07 04:33 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-03-06 21:19 Large table or many small tables? Joel Mc Graw <jmcgraw@databill.com>
2002-03-07 04:33 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox