Re: Cross-Database query engine?
- From: dkasak@xxxxxxxxxxxxxxxxxxxx (Daniel Kasak)
- Date: Wed, 25 Jul 2007 15:01:43 +1000
On Tue, 2007-07-24 at 22:44 -0500, David Nicol wrote:
I'm no database expert but I believe I can answer your question.
On 7/24/07, Daniel Kasak <dkasak@xxxxxxxxxxxxxxxxxxxx> wrote:
Link some tables from one database server.
Link some tables from another database server.
Go to the query builder. Add tables from both database servers. Join
tables where appropriate. Execute query.
So you're saying that Access abstracts the handles to the multiple databases
in such a way that they appear to you as a single database, and you can use the
tools the way you would use on a single database on the combination of the
multiple databases.
That's it exactly. What's more, if you look at MySQL's query log as you
run one of these cross-database queries, you quickly get an idea of how
it works :)
I do not recall seeing such a tool discussed on this mailing list. If
I were tasked
with such a situation I would unfold the various queries, possibly using one of
the perly abstractions such as Tie::DBI or DBIx::SimplePerl and using keys or
each to iterate. At some level, Access must be doing that for you.
I'll look into these, thanks.
The closest thing a cursory CPAN search revealed was
http://search.cpan.org/~dwright/DBD-Multi-0.10/lib/DBD/Multi.pm
which appears to be concerned with load-balancing against data
sources containing identical data rather than abstracting multiple data sources
in a way that the database driver takes apart the queries and sends the various
pieces to the various databases.
That also sounds interesting.
Without knowing for certain that nobody has done what you are looking
for already,
it sounds to me like it would be a welcome addition to the DBI tool kit.
Go for it. I expect that the devil will be in the optimization.
Yes I already have some ideas here too.
Firstly I'll be doing some testing with using SQLite as a local storage
engine. I'll pull the query apart, grab bits of stuff from various DB
servers, and then do the final select against the SQLite DB.
Secondly, from some very limited testing, it looks like I might get a
decent performance boost by creating temporary tables on the DB servers,
inserting a list of keys, and then running queries against these tmp
tables ( as opposed to just sending a huge 'where' clause with all the
keys ).
Thirdly, I'm also investigating using a separate thread to do all
querying, which will make my apps feel much more responsive :)
--
Daniel Kasak
IT Developer
NUS Consulting Group
Level 5, 77 Pacific Highway
North Sydney, NSW, Australia 2060
T: (+61) 2 9922-7676 / F: (+61) 2 9922 7989
email: dkasak@xxxxxxxxxxxxxxxxxxxx
website: http://www.nusconsulting.com.au
.
- Follow-Ups:
- Re: Cross-Database query engine?
- From: Cosimo Streppone
- Re: Cross-Database query engine?
- References:
- Cross-Database query engine?
- From: Daniel Kasak
- Re: Cross-Database query engine?
- From: David Nicol
- Re: Cross-Database query engine?
- From: Daniel Kasak
- Re: Cross-Database query engine?
- From: David Nicol
- Cross-Database query engine?
- Prev by Date: Re: Cross-Database query engine?
- Next by Date: Re: Cross-Database query engine?
- Previous by thread: Re: Cross-Database query engine?
- Next by thread: Re: Cross-Database query engine?
- Index(es):
Relevant Pages
|