Re: huge discrepancy between EXPLAIN cost and actual time (but the table has just been ANALYZED) - Mailing list pgsql-general

From Tom Lane
Subject Re: huge discrepancy between EXPLAIN cost and actual time (but the table has just been ANALYZED)
Date
Msg-id 338272.1683553458@sss.pgh.pa.us
Whole thread Raw
In response to huge discrepancy between EXPLAIN cost and actual time (but the table has just been ANALYZED)  (Kent Tong <kent.tong.mo@gmail.com>)
List pgsql-general
Kent Tong <kent.tong.mo@gmail.com> writes:
> I have a complex query involving over 15 joins and a CTE query and it takes
> over 17s to complete.

If you want constructive comments about that, you're going to need to show
us the whole thing (and the underlying tables' schemas).  Little bits in
isolation are not very intelligible.

https://wiki.postgresql.org/wiki/Slow_Query_Questions

One thought is that you might need to raise from_collapse_limit and/or
join_collapse_limit to at least 15 to get the planner to do a complete
search of the join-order space.

            regards, tom lane



pgsql-general by date:

Previous
From: Ron
Date:
Subject: Re: huge discrepancy between EXPLAIN cost and actual time (but the table has just been ANALYZED)
Next
From: Dilip Kumar
Date:
Subject: Re: "PANIC: could not open critical system index 2662" - twice