Timeline for Agregation group by date or group, pair index, MySQL, slow response
Current License: CC BY-SA 4.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Jun 4, 2022 at 0:23 | answer | added | Wilson Hauck | timeline score: 0 | |
Jun 1, 2022 at 8:51 | comment | added | atay |
@barrycarter I tried to use USE INDEX(search_idx) and it's much, much faster, results in less than 5 seconds for 20 days duration, 1,5 seconds for 5 days, Not sure why MySQL does not use this index, I guess because there is another one that could be used without groups. But that solves my problem, I think. Thank you
|
|
Jun 1, 2022 at 8:42 | comment | added | atay | @barrycarter I used explain and it shows me | 1 | SIMPLE | adgroup_ad_diff | NULL | range | search_idx,IDX_CDAC9A9E3A2C86F0 | search_idx | 10 | NULL | 2143584 | 4.08 | Using index condition | so it's using index I guess, I would try to make an index on date_to column as well, maybe it will help too, as I have separate index on ad_group_name_id already | |
May 31, 2022 at 17:56 | answer | added | Rick James | timeline score: 1 | |
May 31, 2022 at 14:38 | comment | added | Barry Carter | Try EXPLAIN and USING INDEX first (if it's not using the index). Then try creating individual indexes for date_to and ad_group_name_id (it might be more efficient to use a single index and then a non-index technique for the second column) | |
May 31, 2022 at 14:09 | history | asked | atay | CC BY-SA 4.0 |