I have a large # (say 100) of databases with identical schemas and want to do SQL aggregates across this entire collection of databases.
Lets say the table is ATHLETES
CREATE TABLE ATHLETES(JERSEYNUM, FIRSTNAME, LASTNAME, TEAMNAME, SPORT)
I want to be able to dynamically specify a query like
SELECT SPORT, COUNT(*) FROM ATHLETES GROUP BY SPORT
And have it run across all 100 of my databases, producing one combined result set.
The important thing is I want to do this dynamically -- I want to type a SQL query into a PHP-based web UI and execute it.
Also these queries are typically slow (3 min each), so I'd rather they run in parallel then in serial and take 300 mins.