Re: Distributed Join
Posted in 1995
Topics: SQL Development & Query Writing
: Find out more about DBI and you'll be pleasantly surprised : to learn how much it does towards heterogenous, distributed : join optimization. : (cut) : All this and more in just the 2nd release of the product. : If you need more info. pertaining to DBI send me mail at : vishu@broke.enet.dec.com. : - vishu (DB Integrator Development, Digital Equipment Corp.) That covers joins. What about aggregation? For instance, suppose I have two database instances, one with a table called stock_uk and one with a table stock_us. Then on the US instance I define a view stock_corp as 'SELECT * from stock_uk UNION SELECT * from stock_us'. If I then issue the query 'SELECT sum(pieces) from stock_corp', my understanding is that in most implementations, the US database will go and get all rows from stock_uk and then perform the sum. What I'd like would be for the database to execute it as SUM(SUM(stock_uk.pieces)+SUM(stock_us.pieces)). That's easy to define for a SUM, but I'd like it all similarly optimised for other aggregate functions - for instance, I'd like the query 'SELECT AVG(pieces) from stock_corp' (ignore the lack of real-world meaning in that query!) to be executed as (SUM(stock_uk.pieces)+SUM(stock_us.pieces)) / (COUNT(stock_uk.pieces)+COUNT(stock_us.pieces)) And so forth for more and more complex decompositions. Is this something that anyone is doing, or even knows how to do - I imagine that the mathematical theory of how to decompose any given aggregate function into x pieces is not tremendously simple? Henry Harrison hharriso@dircon.co.uk