Skip to content

Optimize queries #7

@ywarnier

Description

@ywarnier

Right now we do most time-related queries with this structure:
SELECT count(down_id) FROM track_e_downloads WHERE DATE_ADD(down_date, INTERVAL 5 MINUTE) >= '2021-09-21 20:50:02';

This seems to be very difficult for MySQL to optimize (not able to use an index on track_e_downoads.down_date, for example).

It looks like a first pre-query to get DATE_ADD() in a string and then just comparing the date string to down_date straight would be enough.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions