Re: Analyze results in more expensive query plan

Tom Lane <[email protected]>
Newsgroups gmane.comp.db.postgresql.performance
Message-ID <[email protected]>
Jeremy Altavilla <[email protected]> writes:
> We have several select statements whose performance is greatly improved by
> deleting some stats from pg_statistic.

You might have better results by setting up some "extended stats" for
the combination of bag_type columns that this query depends on.  Per your
description, there's a fair amount of cross-column correlation, which
the planner will not expect without some extended stats to tell it so.

https://www.postgresql.org/docs/10/planner-stats.html#PLANNER-STATS-EXTENDED

			regards, tom lane
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.