Re: Join for the parent table will not leverage the index scan - Mailing list pgsql-admin

From Vijaykumar Jain
Subject Re: Join for the parent table will not leverage the index scan
Date
Msg-id CAM+6J95KoHhtSZgqO9JLnFcC4OVwaTPTyxt1EVda5u7FFhw2kA@mail.gmail.com
Whole thread Raw
In response to Join for the parent table will not leverage the index scan  (Shrikant Bhende <shrikantpostgresql@gmail.com>)
List pgsql-admin
On Fri, 13 Aug 2021 at 17:54, Shrikant Bhende <shrikantpostgresql@gmail.com> 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

pgsql-admin by date:

Previous
From: Shrikant Bhende
Date:
Subject: Join for the parent table will not leverage the index scan
Next
From: Shrikant Bhende
Date:
Subject: Re: Join for the parent table will not leverage the index scan