Having some issues with slow queries. Getting the good old copying to temp table and a healthy delay while that's done.
It's hitting the thread table so I'm guessing that's the problem as our thread table is rather large.

Threads 878,024 Posts 14,841,008
Any idea if adding an index on thread.vbookie_item_id would help to speed these queries up?
Code:
Command: Query
Time: 16
State: Copying to tmp table
Info: SELECT item.item_id, item.item_title, item.threadid, grp.group_title, item.item_status, item.item_created, item.item_open_until, item.item_pay_after, thread.threadid, thread.forumid, thread.postuserid
FROM vbookie_items AS item
LEFT JOIN vbookie_groups AS grp ON grp.group_id = item.group_id
LEFT JOIN thread AS thread ON thread.vbookie_item_id = item.item_id
WHERE item.item_status='SETTLED'
ORDER BY item.item_id DESC
LIMIT 0, 20
6 rows in set (0.00 sec)
Code:
Command: Query
Time: 45
State: Copying to tmp table
Info: SELECT item.item_id, item.item_title, item.threadid, grp.group_title, item.item_status, item.item_created, item.item_open_until, item.item_pay_after, thread.threadid, thread.forumid, thread.postuserid
FROM vbookie_items AS item
LEFT JOIN vbookie_groups AS grp ON grp.group_id = item.group_id
LEFT JOIN thread AS thread ON thread.vbookie_item_id = item.item_id
WHERE item.item_status='SETTLED'
ORDER BY item.item_id DESC
LIMIT 0, 20
Code:
Command: Query
Time: 3
State: Copying to tmp table
Info: SELECT item.item_id, item.item_title, item.threadid, grp.group_title, item.item_status, item.item_created, item.item_open_until, item.item_pay_after, thread.threadid, thread.forumid, thread.postuserid
FROM vbookie_items AS item
LEFT JOIN vbookie_groups AS grp ON grp.group_id = item.group_id
LEFT JOIN thread AS thread ON thread.vbookie_item_id = item.item_id
WHERE item.item_status='CLOSED'
ORDER BY item.item_pay_after, item.item_id DESC
LIMIT 0, 20
etc...
thanks