Re: Analyze results in more expensive query plan - Mailing list pgsql-performance

From Tom Lane
Subject Re: Analyze results in more expensive query plan
Date
Msg-id 6605.1558100135@sss.pgh.pa.us
Whole thread Raw
In response to Analyze results in more expensive query plan  (Jeremy Altavilla <jeremyaltavilla@gmail.com>)
Responses Re: Analyze results in more expensive query plan  (Jeremy Altavilla <jeremyaltavilla@gmail.com>)
List pgsql-performance
Jeremy Altavilla <jeremyaltavilla@gmail.com> 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



pgsql-performance by date:

Previous
From: Kent Tong
Date:
Subject: Re: using sequential scan instead of index for join with a union
Next
From: Mariel Cherkassky
Date:
Subject: Trying to handle db corruption 9.6