a query which cannot be fast even theoretically?

2001-02-26 Thread Kent Hoover
Your table bb is not indexed in a way that helps this query. Creating an index on min_number may help somewhat. If your intervals DON'T overlap each other, there's probably a much better algorithm for you to use than an SQL join. (e.g., select each number from aa in sequence, form a query for

a query which cannot be fast even theoretically?

2001-02-23 Thread Artem Koutchine
Hi! Here is a worst case i have even seem so far: create table aa( some_numberint unsigned not null, indexaa_sn (some_number) ); create table bb( min_numberint unsigned not null, max_numberint unsigned not null, range_typechar(1) not null, primary