From: Tom Lane <tgl@sss.pgh.pa.us>
To: Josh Berkus <josh@agliodbs.com>
Cc: postgres performance list <pgsql-performance@postgresql.org>
Subject: Re: Strange choice of general index over partial index
Date: Thu, 15 Jan 2015 20:48:24 -0500
Message-ID: <4423.1421372904@sss.pgh.pa.us> (raw)
In-Reply-To: <54B83F70.7080004@agliodbs.com>
References: <54B83F70.7080004@agliodbs.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>
Josh Berkus <josh@agliodbs.com> writes:
> index file_state on (state)
> (35GB in size)
> index file_in_flight_state (state) where state in (
> 'waiting','assigning', 'processing' )
> (600MB in size)
> ... 10 more indexes
> More important facts:
> * state = 'done' 95% of the time. thereform the partial index
> represents only 5% of the table
> * all indexes and the table are very bloated
> * server has 128GB RAM
> * Version 9.2.
9.2.what? And how much of the table is 'waiting' state?
> What am I missing? Or is this potentially a planner bug for costing?
The only real difference between the two cases is index descent costs:
the number of heap pages visited will be the same whichever index is
used, and the number of index leaf pages visited is probably about the
same too. 9.3 is the first release that makes any real attempt to
model index descent costs realistically. Before that there were some
dubious fudge factors, which we're unlikely to change in long-stable
branches no matter how badly the results might suck in specific instances.
Having said that, though, I'd have thought that the old fudge factors
would strongly prefer the smaller index given such a large difference in
index size. Have you neglected to mention some nondefault planner cost
settings?
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, josh@agliodbs.com
Subject: Re: Strange choice of general index over partial index
In-Reply-To: <4423.1421372904@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