Slow queries при использовании related по спонсору

Постим сюда все найденые ошибки
Post Reply
xawm
Posts: 542
Joined: Tue Dec 25, 2012 6:37 pm

Slow queries при использовании related по спонсору

Post by xawm »

Включил вывод related по спонсору и в slow-query.log стали логироваться медленные запросы. Пример:

Code: Select all

# Query_time: 6.952472  Lock_time: 0.000274  Rows_sent: 135  Rows_examined: 5201251
SET timestamp=1541414402;
SELECT   gs.gallery_id, gs.thumb_id, gi.sponsor_id, gi.content_count, gi.content_type, gs.total_shows, gs.total_clicks, gs.total_ctr, gt.thumb_url, gd.*, gi.content_count, gi.crop_profile_id, gi.activation_date, gi.added_date, gi.duration, gi.url, gi.gallery_total_shows, gi.sponsor_id, gi.source_url, gi.custom_gallery  FROM rot_gallery_stats15 as gs  FORCE INDEX (tested_thumb_index)  JOIN rot_gallery_info as gi on gi.gallery_id = gs.gallery_id
JOIN rot_gallery_data15 as gd on gd.gallery_id = gs.gallery_id
  JOIN rot_thumbs as gt on gt.thumb_id = gs.thumb_id
                        WHERE 1 = 1  AND gi.gallery_status = 'active'  AND gi.gallery_type = 0  and gs.tested_thumb = 'no'  and gi.sponsor_id NOT IN (887,888,889)  and gs.group_id = 0  and gs.gallery_id NOT IN ( SELECT gallery_id FROM rot_gallery_stats15 WHERE group_id IN (248))  and gi.sponsor_id IN (7)  AND gs.gallery_id NOT IN ('78725','79316','79256','79212','79283','77951','77913','78331','79207','79228','79259','79190','79280','78604','77824','77928','77567','77518','77829','78737','77632')  ORDER BY  gs.total_ctr DESC  LIMIT 20, 135# queryitems;
Ну или мне показалось что это от него, но медленные запросы есть.

доступ если что шарил в viewtopic.php?f=10&t=97106
admin
Site Admin
Posts: 37202
Joined: Wed Sep 10, 2008 11:43 am

Re: Slow queries при использовании related по спонсору

Post by admin »

Спасибо, поправили индекс
Don't forget to run script update
Post Reply