New resuts:

mysql> CREATE INDEX title ON recorded (title);
Query OK, 738 rows affected (0.27 sec)
Records: 738  Duplicates: 0  Warnings: 0

mysql> CREATE INDEX findid ON recorded (findid);
Query OK, 738 rows affected (0.25 sec)
Records: 738  Duplicates: 0  Warnings: 0

reduced the giant query from 19.19 seconds to 5.90 seconds. Now that's
what I'm talking about!

My EXPLAIN output is pretty different from your still. Don't know yet
if adding indexes will improve things much.

Thanks, a lot man.

+-------------+--------+------------------------+----------+---------+------------------------------------------+------+-----------------+
| table       | type   | possible_keys          | key      | key_len |
ref                                      | rows | Extra           |
+-------------+--------+------------------------+----------+---------+------------------------------------------+------+-----------------+
| record      | ALL    | PRIMARY                | NULL     |    NULL |
NULL                                     |  356 | Using temporary |
| cardinput   | ALL    | NULL                   | NULL     |    NULL |
NULL                                     |    1 |                 |
| recordmatch | ref    | recordid               | recordid |       5 |
record.recordid                          |    9 | Using where     |
| program     | eq_ref | PRIMARY,id_start_end   | PRIMARY  |      12 |
recordmatch.chanid,recordmatch.starttime |    1 |                 |
| channel     | eq_ref | PRIMARY                | PRIMARY  |       4 |
program.chanid                           |    1 | Using where     |
| capturecard | eq_ref | PRIMARY                | PRIMARY  |       4 |
cardinput.cardid                         |    1 | Using index     |
| oldrecorded | ref    | title,programid        | title    |     128 |
program.title                            |    7 |                 |
| recorded    | ref    | programid,title,findid | title    |     128 |
program.title                            |   21 |                 |
+-------------+--------+------------------------+----------+---------+------------------------------------------+------+-----------------+
_______________________________________________
mythtv-dev mailing list
mythtv-dev@mythtv.org
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-dev

Reply via email to