Changes between Version 4 and Version 5 of Ticket #23242, comment 10


Ignore:
Timestamp:
Dec 17, 2017, 10:20:27 AM (6 years ago)
Author:
Simon Charette

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #23242, comment 10

    v4 v5  
    11While it's still possible that getting rid of the the `DISTINCT` generated by `dates()` might help I wonder, by looking at the provided PostgreSQL plan in comment:3, if the actual culprit  of the slow query was the `EXTRACT('month')` all along as related in #28933.
    22
    3 I also wonder if `LIMIT`'ing the results to `12` in in the case of `year&month` might help the database engine engine figure out that it can stop the `DISTINCT` processing once it retrieved 12 results.
     3I also wonder if `LIMIT`'ing the results to `12` in in the case of `year&month` might help the database engine engine figure out that it can stop the `DISTINCT` processing once it retrieved 12 results. The `ORDER BY` clause would have to be dropped here or wrapped around the `LIMIT`ed query.
    44
    55Another option would to stop using `dates` (or allow passing a range to it) for `year&month` and `year&month&day` filtering and use a combination of `generate_series` and `EXISTS` to speed up the query.
Back to Top