[development] Improve multiple database handling
Rowan Kerr
rowan at stasis.org
Thu Jan 18 05:18:18 UTC 2007
On 1/17/07, adrian rossouw <adrian at bryght.com> wrote:
> This is a duplicate of http://drupal.org/node/19522
>
> I just updated with the DRUPAL 5 version of the patch, but I also harbor
> some performance concerns,
> especially since Dries benchmarked and found us losing a lot of time in the
> db api.
Oops.. the other issue was the only one I saw in my search.
Thanks for marking the dupe.
So it's basically the same solution as mine, then.
Although I didn't make an invoke hook, I just made eg. db_query use
$db_type as a global variable and call db_($db_type)_query function.
Maybe that's slightly quicker.
I think the flexibility of this feature (and properly supporting
multiple db connections as advertised) is worth a slight performance
hit.
Having different table prefixes per-db connection is another story
(but one which I find quite useful since it allows you to use drupal's
db api on other databases which may not contain a full set of drupal
tables, or be configure the same as your primary database) ... perhaps
that is genuinely worth a new issue.
-Rowan
More information about the development
mailing list