Re: Slow Planning Times

2022-04-06 Thread Saurabh Sehgal
I just figured this out. Someone had set the default_statistics_target to 5000 instead of 500 I think. I changed it to 500, ran analyze and planning time is much better. In case someone runs into this problem, sending this out here. Thank you all. On Wed, Apr 6, 2022 at 7:57 PM Tom Lane wrot

Re: Slow Planning Times

2022-04-06 Thread Tom Lane
"David G. Johnston" writes: > On Wed, Apr 6, 2022 at 5:27 PM Saurabh Sehgal wrote: >> I have the following query: >> I don't think it is super complex. But when I run explain analyze on this >> I get the following: >> Planning Time: 578.068 ms >> Execution Time: 0.113 ms > The fundamental issue

Re: Slow Planning Times

2022-04-06 Thread Saurabh Sehgal
I added the additional where clauses to remove needing to join multiple columns which I guess didn't really help. This is the original query: *SELECT* rr.* *FROM* rpc rpc *INNER* *JOIN rr* rr *ON* rr.uuid = rpc.rr_id

Re: Slow Planning Times

2022-04-06 Thread David G. Johnston
On Wed, Apr 6, 2022 at 5:27 PM Saurabh Sehgal wrote: > > I have the following query: > > *explain* (*analyze*, costs, timing) *SELECT* rr.* *FROM* rpc rpc > >*INNER* *JOIN* rr rr > >*ON* rr.uuid = rpc.rr_id > >*INNER* *

Re: Slow Planning Times

2022-04-06 Thread Saurabh Sehgal
To clarify - I have run "vaccum full" and "vacuum analyze" on every single table involved in the query and the planning times are still around the same and were not impacted. On Wed, Apr 6, 2022 at 5:26 PM Saurabh Sehgal wrote: > > I have the following query: > > *explain* (*analyze*, costs, t

Slow Planning Times

2022-04-06 Thread Saurabh Sehgal
I have the following query: *explain* (*analyze*, costs, timing) *SELECT* rr.* *FROM* rpc rpc *INNER* *JOIN* rr rr *ON* rr.uuid = rpc.rr_id *INNER* *JOIN* rs rs *ON* rs.r_id = rpc.r_id