Paul J Stevens wrote:
It's not the number of rows in messageblks that is your problem, but the
rediculous rowscan in the explain output. Could you run that 'explain
select' again?

Now, this is interesting:
-------------------------------------------------------------------------------------------------------------------
explain select messageblk, is_header from dbmail_messageblks where physmessage_id=364483 order by messageblk_idnr;
+----+-------------+--------------------+-------+-----------------------------------------------------+---------+---------+------+---------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+--------------------+-------+-----------------------------------------------------+---------+---------+------+---------+-------------+
| 1 | SIMPLE | dbmail_messageblks | index | physmessage_id_index,physmessage_id_is_header_index | PRIMARY | 8 | NULL | 1605498 | Using where |
+----+-------------+--------------------+-------+-----------------------------------------------------+---------+---------+------+---------+-------------+
1 row in set (0.00 sec)
-------------------------------------------------------------------------------------------------------------------


but if I now run:
-------------------------------------------------------------------------------------------------------------------
explain select messageblk, is_header from dbmail_messageblks where physmessage_id=364483;+----+-------------+--------------------+------+-----------------------------------------------------+--------------------------------+---------+-------+------+-------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+--------------------+------+-----------------------------------------------------+--------------------------------+---------+-------+------+-------+
| 1 | SIMPLE | dbmail_messageblks | ref | physmessage_id_index,physmessage_id_is_header_index | physmessage_id_is_header_index | 8 | const | 1 | |
+----+-------------+--------------------+------+-----------------------------------------------------+--------------------------------+---------+-------+------+-------+
1 row in set (0.00 sec)
-------------------------------------------------------------------------------------------------------------------

May the problem be in how the db server treats the "order by" clause?

I'm currently running mysql 5.1.28. I may try to downgrade to 5.0.x, but I'm
loath to do that. Maybe I should contact the mysql guys to raise a bug
or something?
_______________________________________________
DBmail mailing list
[email protected]
https://mailman.fastxs.nl/mailman/listinfo/dbmail

Reply via email to