Hi,
I just ran into a very strange problem. I have two simple tables with
BIGINT(16) PKs. The primary table has 7500 records and the secondars has
15000. If I execute:
SELECT * FROM lad JOIN snd ON lad.id = snd.lad_id
The query takes 8 seconds. If I execute this one:
SELECT * FROM lad LEFT
Christofer Dutz wrote:
Hi,
I just ran into a very strange problem. I have two simple tables with
BIGINT(16) PKs. The primary table has 7500 records and the secondars has
15000. If I execute:
SELECT * FROM lad JOIN snd ON lad.id = snd.lad_id
The query takes 8 seconds. If I execute this one:
Ok ... here all the information I could find:
CREATE TABLE `disco_lad` (
`id` bigint(16) unsigned NOT NULL auto_increment,
`import_datum` date default NULL,
`import_zeit` time default NULL,
`gst` smallint(4) unsigned default '0',
`gst_bez` varchar(40) default NULL,
`betrieb`
Looks like you don't have index on `lad_id` field in second table.
So when you do the first query, mysql first does a full scan of 2nd
table, then does eqref lookup for 1st table, which is rather fast
operation. But when you do the left join, it scans first table and for
each value of id does a