Closed (fixed)
Project:
Webform
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
13 Apr 2007 at 22:12 UTC
Updated:
10 Jun 2007 at 21:16 UTC
There are some strategic indexes that are not working, making the tables very slow with large joins. This works very well in combination with the previous patch I sent that changes the LEFT JOIN's into INNER JOINS.
Here is the EXPLAINS without and then with the patch:
WITHOUT
mysql> EXPLAIN
-> SELECT s.sid, s.submitted, s.remote_addr, sd.cid, sd.no, sd.data
-> FROM webform_submissions as s
-> LEFT JOIN webform_submitted_data as sd on (sd.sid = s.sid)
-> WHERE sd.nid = 8012;
+----+-------------+-------+------+---------------+---------+---------+----------------------+-------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+------+---------------+---------+---------+----------------------+-------+-------------+
| 1 | SIMPLE | s | ALL | NULL | NULL | NULL | NULL | 31667 | |
| 1 | SIMPLE | sd | ref | PRIMARY | PRIMARY | 8 | const,stevedev.s.sid | 2952 | Using where |
+----+-------------+-------+------+---------------+---------+---------+----------------------+-------+-------------+
WITH
mysql> EXPLAIN
-> SELECT s.sid, s.submitted, s.remote_addr, sd.cid, sd.no, sd.data
-> FROM webform_submissions as s
-> LEFT JOIN webform_submitted_data as sd on (sd.sid = s.sid)
-> WHERE sd.nid = 8012;
+----+-------------+-------+------+---------------+------+---------+-----------------+--------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+------+---------------+------+---------+-----------------+--------+-------------+
| 1 | SIMPLE | sd | ALL | PRIMARY,sid | NULL | NULL | NULL | 332068 | Using where |
| 1 | SIMPLE | s | ref | sid | sid | 4 | stevedev.sd.sid | 1 | |
+----+-------------+-------+------+---------------+------+---------+-----------------+--------+-------------+
steve
| Comment | File | Size | Author |
|---|---|---|---|
| webform_install_0.patch | 2.25 KB | slantview |
Comments
Comment #1
quicksketchRock. Thanks Steve. I've put this into the 5.x dev version of webform and it will make it into 1.3. Thanks!
Comment #2
quicksketchComment #3
(not verified) commented