PDA

View Full Version : Move main site tables into vB DB


JohnGaf
01-03-2008, 08:16 PM
Hi there,

We have a large vBulletin forum and a custom CMS for our main pages which is currently in two different databases. The main page database has around 20 tables in it.

Was just snooping around on phpMyAdmin earlier and looking at the different query types and saw that "change db" was 34.84% of the queries.

Was just thinking that if I move all the tables to the same database as vB (and perhaps just add a prefix to get more of a system) we would save 1/3 of the queries, which would help a lot on the mySQL server which is already struggling.

Could anyone think of disadvantages by doing it this way?

Quick SQL stats:
This MySQL server has been running for 1 days, 1 hours, 4 minutes and 12 seconds. It started up on Jan 02, 2008 at 09:00 PM.

Query statistics: Since its startup, 21,645,953 queries have been sent to the server.

Average queries pr second: 239

SEOvB
01-03-2008, 08:41 PM
You can always test it out, see if the mySQL server load drops and if it does then good move.

If not you can always just move them back and chalk it up as a learning experience :D

JohnGaf
01-03-2008, 08:53 PM
Yeah, but I was thinking more in the lines if vB (or some operations from the Control Panel) could do something to the "unknown" tables that don't have anything to do with vB.

SEOvB
01-04-2008, 02:21 AM
Not unless you've got tables named the same on your CMS as vbulletin uses, but that can be fixed by using prefixes such as CMS_tablename and vb3_tablename or the such

Marco van Herwaarden
01-04-2008, 05:41 AM
I doubt merging the databases would make any difference (maybe even negative). Change DB is a very inexpensive operation and will anyways need to be done once for each connection. I don't know how your custom application is written, but it will create a connection to a database anyways, this connection must select a database to operate on and i doubt your application will re-use the vB connection even if they are both in the same database.