Re: Analyze results in more expensive query plan

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jeremy Altavilla <jeremyaltavilla(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Analyze results in more expensive query plan
Date: 2019-05-17 13:35:35
Message-ID: 6605.1558100135@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Jeremy Altavilla <jeremyaltavilla(at)gmail(dot)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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Mariel Cherkassky 2019-05-20 14:39:48 Trying to handle db corruption 9.6
Previous Message Kent Tong 2019-05-17 09:36:03 Re: using sequential scan instead of index for join with a union