On Fri, 13 Aug 2021 at 17:54, Shrikant Bhende <shrikantpostgresql@xxxxxxxxx> wrote:
The only place an index scan is used is to filter down page_details. In my second query,
when explicitly joining single partitions an index scan is used to perform filtering, and the join as well:
can you share the results of explain via New explain | explain.depesz.com
explain analyze <query>
set enable_seqscan TO off;
explain analyze <query>
maybe the planner seems to find seq scans faster than index scans.
The plan used by the optimizer should help understand the decision.
Also, I assume the tables were analyzed too.
If not, please run analyze on the tables.
also what do you see with enable_partitionwise_join enabled
set enable_partitionwise_join to on;
explain analyze <query>
set enable_seqscan TO off;
explain analyze <query>
Thanks,
Vijay
Mumbai, India