John Mark
John Mark

Reputation: 11

Database Design: Many tables VS One "long" table _ Performance-Wise?

Just from a performance point of view:

Store with 10s of 1000s of items with so many categories and attributes. Which is better to store all attributes in one table. Or categorize them in different tables but in this case I'll have to search through all tables for a certain attribute.

Also, What if I used more than one database to store the items. Again, from a performance point of view.

Upvotes: 1

Views: 402

Answers (1)

Gordon Linoff
Gordon Linoff

Reputation: 1270843

Databases are designed to store and manage data. Thousands of rows is considered a "small" table.

You should store all the information about attributes in one table, assuming the attributes are common across all items. The reasons for using multiple databases would involve security or backup requirements.

If you do get really big tables (say tens of millions of rows) and performance is an issue, then you can start learning about (vertical) partitions.

Upvotes: 1

Related Questions