I’m trying to run the following query from phpMyAdmin (on a local WAMP server):
SELECT table2.AreaName, table2.Dialcode
FROM table2
LEFT JOIN
master
ON master.Dialcode = table2.Dialcode
WHERE master.Dialcode IS NULL
I first tried on two tables with 4 entries in each and I got a result.
Now I’m trying (the same query) on my "real" tables with around 20000 entries each and I click on GO. During 5-6 seconds I have "Loading3 appearing in the middle but then nothing happen, no result, anything loading…
Any idea?
EDIT:
SHOW INDEXES FROM MASTER
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type
master 1 Dialcode 1 Dialcode A 18731 NULL NULL YES BTREE
And the same thing for the table2.
I already created indexes of the tables on DialCode by clicking on the INDEX button in PhpMyadmin.
SOLUTION: Actually the query works fast, that’s the treatment I do after which takes time.
I have just created a very simple mock up of your scenario and it returns in 0.03s with 1M records in table2 and 70K records in master. You probably need to add indices to the fields used for the join –