Jon N Posted July 11, 2008 Share Posted July 11, 2008 table1 = 6,300,000 rows Index: DB1.table1.IP [4] Fields used: DB1.table1.IP, DB1.table1.lat, DB1.table1.long, DB1.table1.current table2 = 1,400,000 rows Index: DB2.table2.id_a [1] Fields used: DB2.table2.id_a table3 = 718,000 rows Index: DB2.table3.id_a [3] Fields used: DB2.table3.id_a, DB2.table3.IP, DB2.table3.option __________________________________________________________________ SELECT DB1.table1.lat, DB1.table1.long, Count(DB2.table2.id_a) AS count_all FROM DB2.table3 Inner Join DB2.table2 ON DB2.table2.id_a = DB2.table3.id_a Inner Join DB1.table1 ON DB2.table3.IP = DB1.table1.IP WHERE DB2.table3.option = '-1' AND DB1.table1.current = 'AB' GROUP BY DB1.table1.lat, DB1.table1.long LIMIT 2000 Quote Link to comment Share on other sites More sharing options...
Jon N Posted July 11, 2008 Author Share Posted July 11, 2008 EXPLAIN SELECT: id select_type table type possible_keys key key_len ref rows Extra 1SIMPLEtable2indexid_aid_a4(Null)1,412,817Using index; Using temporary; Using filesort1SIMPLEtable3refPRIMARY,id_aPRIMARY4DB2.table2.id_a1Using where1SIMPLEtable1eq_refPRIMARY,IPPRIMARY4DB2.table3.IP1Using where Quote Link to comment Share on other sites More sharing options...
fenway Posted July 14, 2008 Share Posted July 14, 2008 Is this really across two databases? Why only 1 row matching in tables 2 and 3? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.