3 ms·
Isn’t this what EXPLAIN ANALYZE is for though?
by DrJokepu 8y ago
Isn’t this what EXPLAIN ANALYZE is for though?
- Izkata 8y agoThat actually runs the query, so in GP's situation where it isn't returning, that won't either.
- magicalhippo 8y agoAt least in my experience, things being slow is almost always due to a table scan rather than using an index. Just the estimates (ie not actually running the query) should give clues as to which table it scans, and the predicates gives hints as to which index would have helped. Not always easy fix though, sometimes what you're asking for just isn't possible to index in a nice way. Just the other day me and a colleague was trying to optimize a query, and we couldn't get it to use the index simply because the selectivity was too low. The most selective part of the where clause was a non-trivial and highly dynamic "exists" sub-query... We ended up using a few materialized views with manual refresh but still the query took 2-3 seconds (down from 10-15).
- Izkata 8y agoYes, but to identify that all you need it EXPLAIN, not EXPLAIN ANALYZE.