![]() |
My co-developer and I are working on using 2 mySQL databases for vB - to lighten the load on attachments. We've run into some teething problems replicating the $DB_site-> function ($DB_attach->)
Is it possible to use 2 databases at once? Is it known to cause problems? Should we close the connections to 1 db before quering the other? Thanks for any help. |
If you are using the same user/pass for the two databases, it's really simple actually. :)
All you need to do, is first move the attachment table from one db to the other. Then, find all places where you have SELECT [...] FROM attachment, and change that to newDBname.attachment (also do that for JOINs with the attachment table). The places I can currently think about are: showthread.php (where you select the posts there should be a reference there to that table) attachment.php (duh) functions.php (acceptupload() is the function that actually adds the files to the database...) Good luck. :) |
(And if you don't have the same user/pass for the databases, first yell at your host for being dense, then... I don't know. :))
|
The problem is it's not on the same server. 2 different databases on 2 different servers. So if i'm not mistaken your solution would only help if the 2 db's are on the same server?
Thanks |
Yup... heh I was wondering how it would help to have two databases on the same servers rather than one. :)
In that case, just copy the code from global.php that starts $DB_site, and duplicate it using $DB_attach... then use that new object when selecting stuff from attachment table, although you will have problems with JOINs. |
Yeah - we're looking at re-writting these queries now, which I am guessing will make it less effcient - but we'll see when we get there. :)
|
All times are GMT. The time now is 09:20 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|