vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   Dual databases (https://vborg.vbsupport.ru/showthread.php?t=34687)

Martz 02-01-2002 10:46 AM

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.

Admin 02-01-2002 11:32 AM

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. :)

Admin 02-01-2002 11:34 AM

(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. :))

Martz 02-02-2002 12:08 AM

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

Admin 02-02-2002 05:17 AM

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.

Martz 02-02-2002 08:48 PM

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
  • Page Generation 0.00992 seconds
  • Memory Usage 1,713KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (6)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete