From: Tom Lane <tgl@sss.pgh.pa.us>
To: Dieter Komendera <dieter@komendera.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Bad plan choices & statistic targets with a GIN index
Date: Thu, 14 Nov 2013 10:00:14 -0500
Message-ID: <1719.1384441214@sss.pgh.pa.us> (raw)
In-Reply-To: <675CE272-1EE1-4366-BF94-5E1AC075B5A5@komendera.com>
References: <675CE272-1EE1-4366-BF94-5E1AC075B5A5@komendera.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
Dieter Komendera <dieter@komendera.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
--
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: tgl@sss.pgh.pa.us, dieter@komendera.com
Subject: Re: Bad plan choices & statistic targets with a GIN index
In-Reply-To: <1719.1384441214@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox