Обсуждение: Large table or many small tables?
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-----
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