Does the number of tables in a DB affect performance?

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
JayBird
Admin
Posts: 4524
Joined: Wed Aug 13, 2003 7:02 am
Location: York, UK
Contact:

Does the number of tables in a DB affect performance?

Post by JayBird »

As to topic title says.

I have 86 tables in my DB, is that a lot? Will performance be reduced compared to if i only had one table?

I am only ever querying 1 table at a time on any one page of my site.

Cheerz

Mark
User avatar
brewmiser
Forum Commoner
Posts: 74
Joined: Mon Aug 18, 2003 12:50 pm
Location: Dallas, TEXAS

Post by brewmiser »

I have read that the amount of tables do not matter, and that it could be a better design if you have more tables with a lot of differnt types of data to be stored.

To put it simply, if I was looking for a certain type of orange among all the other fruits in the world, then it would be easier to find this under a table named orange's, and not to look through all the different fruits just to find that orange.

Does this make sense? Does anyone disagree with me? :lol:
Coco
Forum Contributor
Posts: 339
Joined: Sat Sep 07, 2002 5:28 am
Location: Leeds, UK
Contact:

Post by Coco »

i think the question really is... is it more efficient to have separate tables for each kinda of fruit, or a single table with a collumn denoting which type of fruit you are after

personally i would say it depends, on how many lines of data, and how often you will be doing a select...
eg if it was an archive table then you shouldnt be using it much... but if it was a sales database or something that you use alot, then it might be better to split it up a little... to make the selects faster

and even then most the efficiency gained is in the human department... its easier to understand a db with a few tables, but one with alot takes more brain power :p
Post Reply