Re: Bad plan choices & statistic targets with a GIN index

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dieter Komendera <dieter(at)komendera(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Bad plan choices & statistic targets with a GIN index
Date: 2013-11-14 15:00:14
Message-ID: 1719.1384441214@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Dieter Komendera <dieter(at)komendera(dot)com> writes:
> Because I didn't find any documentation or references on setting statistic targets on indices, I just gave it a shot:

> ALTER TABLE index_games_participants ALTER COLUMN "array" SET STATISTICS 1000;

This works, and will help if the planner can make use of statistics on the
expression the index is indexing. The reason it's not documented is that
it's not considered supported (yet), primarily because pg_dump won't dump
such a setting. And the reason for that is mainly that the column names
of an index aren't guaranteed stable across PG versions. But as long
as you're willing to remember to restore the setting manually, it's
a reasonable thing to do if it helps your query plans.

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Patrick Krecker 2013-11-15 22:24:53 General slowness when retrieving a relatively small number of rows
Previous Message Dieter Komendera 2013-11-14 14:36:57 Bad plan choices & statistic targets with a GIN index