1 (edited by Paul 2004-10-29 21:01)

Topic: MySQL Question

I have always assumed that it is better from a performance point of view to create a new database for each php script rather than have them all run on the same database with a different table prefix e.g. several installation of PunBB. I was just wondering whether this was actually correct.

The reason for the question is it makes a difference regarding hosting requirements.

Re: MySQL Question

id assume that it was like that (after writing this i guess not..). if you have a database for each install, and you have 20 installs, it finds the database, and serchs through that for the info. but, it has more databases to search thorugh, which i think would slow it down.

if its the same datbase for all of them, it finds the correct database right away and then has a long list of tables to sort through to find the correct one.

i make a new database on most of my servers for everything, unless im limited on them. IE. on my home server, i have unlimited (no duh), but at http://indocron.net i only get 6 databases, so i have to limit them. it makes it alot neater for a new database for everything



for a short answer, i dont think it makes a difference.

Indocron
$theQuestion = (2*b) || !(2*b);

Re: MySQL Question

I'm gonna go with Gary13579 here. I really don't think it matters unless we're talking about a lot of applications in the same database. I doubt you can measure a performance drop with less than, say, 500 tables in the same database. This is all speculation though.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: MySQL Question

i would get just for organisation its better to use different databases for different sites if possible

Re: MySQL Question

Yes it doesn't make any difference if we use many tables in a single database, just to differentiate the applications we use, we can use different databases. that too, for our convenience.

God wisely designed the human body so that we can neither pat our own backs nor kick ourselves too easily