FW: optimizer bug: SELECT * FROM tbl_name,tbl_name2 ... ORDER BY

FW: optimizer bug: SELECT * FROM tbl_name,tbl_name2 ... ORDER BY

am 06.08.2002 14:13:02 von Gunnar

Hi Peter,

thank for your answer.

Peter wrote:
> I've just checked the simple query and it seems to work:
>
> CREATE TABLE `a` (
> `s` tinyint(3) unsigned NOT NULL default '0',
> `l` int(11) default NULL,
> KEY `s` (`s`,`l`)
> ) TYPE=MyISAM
>
> mysql> explain select * from a order by s limit 2;
>
+-------+-------+---------------+------+---------+------+--- ---+------------
-+
> | table | type | possible_keys | key | key_len | ref | rows | Extra
|
>
+-------+-------+---------------+------+---------+------+--- ---+------------
-+
> | a | index | NULL | s | 6 | NULL | 20 | Using
index |
>
+-------+-------+---------------+------+---------+------+--- ---+------------
-+
> 1 row in set (0.00 sec)



How-To-Repeat:

You forgot to use a JOIN in your test query!
The Problem is related to queries with JOINS and ORDER BY.
Like this query: SELECT * FROM tbl_name,tbl_name2 ORDER BY key_part1 LIMIT
10


Anyway, I'll send you a database dump shortly.



best regards

Gunnar

------------------------------------------------------------ ---------
Before posting, please check:
http://www.mysql.com/manual.php (the manual)
http://lists.mysql.com/ (the list archive)

To request this thread, e-mail bugs-thread12303@lists.mysql.com
To unsubscribe, e-mail