Note the difference:

mysql> explain select * from syslogs_main where
host='openview.cc.umr.edu' and msg like '%IPACCESS%';
+--------------+------+---------------+--------+---------+-------+-------+------------+
| table        | type | possible_keys | key    | key_len | ref   | rows 
| Extra      |
+--------------+------+---------------+--------+---------+-------+-------+------------+
| syslogs_main | ref  | sl_hsp        | sl_hsp |      50 | const | 20487
| where used |
+--------------+------+---------------+--------+---------+-------+-------+------------+
1 row in set (0.00 sec)

mysql> explain select * from syslogs where host='openview.cc.umr.edu'
and msg like '%IPACCESS%';
+---------+------+---------------+------+---------+------+--------+------------+
| table   | type | possible_keys | key  | key_len | ref  | rows   |
Extra      |
+---------+------+---------------+------+---------+------+--------+------------+
| syslogs | ALL  | NULL          | NULL |    NULL | NULL | 754049 |
where used |
+---------+------+---------------+------+---------+------+--------+------------+
1 row in set (0.57 sec)


Syslogs is a merge table over syslogs_main (and several others).

Appears the output is wrong, cause the queries take about the same time.

I'm not sure if it would be the ideal approach, but I'd be happy with
explain on a merge table generating a row in the response for each table
in the merge. ie:

+----------------+------+---------------+--------+---------+-------+-------+------------+
| table          | type | possible_keys | key    | key_len | ref   |
rows  | Extra      |
+----------------+------+---------------+--------+---------+-------+-------+------------+
| syslogs_main   | ref  | sl_hsp        | sl_hsp |      50 | const |
20487 | where used |
| syslogs_mail   | ref  | sl_hsp        | sl_hsp |      50 | const |
20487 | where used |
| syslogs_dhcp   | ref  | sl_hsp        | sl_hsp |      50 | const |
20487 | where used |
| syslogs_mredir | ref  | sl_hsp        | sl_hsp |      50 | const |
20487 | where used |
+----------------+------+---------------+--------+---------+-------+-------+------------+



-- Nathan

------------------------------------------------------------
Nathan Neulinger                       EMail:  [EMAIL PROTECTED]
University of Missouri - Rolla         Phone: (573) 341-4841
CIS - Systems Programming                Fax: (573) 341-4216

---------------------------------------------------------------------
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 <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


Reply via email to