4 ms·
I think the date_format call forces a table scan, the query could be rewritten to be much faster. Optimizing the sql statement seems less error prone than extra
by pytyper2 8y ago
I think the date_format call forces a table scan, the query could be rewritten to be much faster. Optimizing the sql statement seems less error prone than extracting the data to text files.
- barrkel 8y agoThere's no predicate or limit or inner join that could reduce the set of rows, so the table might as well be scanned.
- deleted 8y ago[deleted]
- pytyper2 8y agoOr precompute the date on insert, there are a dozen ways to refactor the data model and the query, all of which are better than extracting to txt files, a format with no schema and not based on a standard. That would be the direction I would give if a junior dev was attempting this method.