pg.ddx.io  pgsql-patches@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: Teodor Sigaev <teodor@sigaev.ru>
Cc: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: Pgsql Hackers <pgsql-hackers@postgresql.org>
Subject: Re: [PATCHES] GIN improvements
Date: Mon, 09 Feb 2009 14:54:05 -0500
Message-ID: <20441.1234209245@sss.pgh.pa.us> (raw)
In-Reply-To: <1233782589.3805.12.camel@dell.linuxdev.us.dell.com>
References: <483FD205.4090904@sigaev.ru>
	<1232348905.7281.114.camel@jdavis>
	<4974B002.3040202@sigaev.ru>
	<1232474489.23316.8.camel@jdavis>
	<49770FD4.5030600@sigaev.ru>
	<1232561271.23793.46.camel@jdavis>
	<497864DC.5080800@sigaev.ru>
	<4979BAF8.1000501@sigaev.ru>
	<16080.1233625091@sss.pgh.pa.us>
	<1233772747.3805.2.camel@dell.linuxdev.us.dell.com>
	<603c8f070902041140h35c2aeo8c4ed79cd16400f8@mail.gmail.com>
	<1233782589.3805.12.camel@dell.linuxdev.us.dell.com>

Jeff Davis <pgsql@j-davis.com> writes:
> On Wed, 2009-02-04 at 14:40 -0500, Robert Haas wrote:
>> Well, there's nothing to force that plan to be invalidated when the
>> state of the pending list changes, is there?

> Would it be unreasonable to invalidate cached plans during the pending
> list cleanup?

If the pending list cleanup is done by VACUUM then such an invalidation
already happens (VACUUM forces it after updating pg_class.reltuples/
relpages).  What's bothering me is the lack of any reasonable mechanism
for invalidating plans in the other direction, ie when the list grows
past the threshold where this code wants to turn off indexscans.  Since
the threshold depends on parameters that can vary across sessions, you'd
more or less have to send a global invalidation after every addition to
the list, in case that addition put it over the threshold in some other
session's view.  That's unreasonably often, in my book.

Also, as mentioned earlier, I'm pretty down on the idea of a threshold
where indexscans suddenly turn off entirely; that's not my idea of how
the planner ought to work.

But the real bottom line is: if autovacuum is working properly, it
should clean up the index before the list ever gets to the point where
it'd be sane to turn off indexscans.  So I don't see why we need to hack
the planner for this at all.  If any hacking is needed, it should be
in the direction of making sure autovacuum puts sufficient priority
on this task.

			regards, tom lane



view thread (74+ messages)  latest in thread

Message-ID: <20441.1234209245@sss.pgh.pa.us>
Permalink:  ../20441.1234209245@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/20441.1234209245@sss.pgh.pa.us

 · 

reply

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-patches@postgresql.org
  Cc: tgl@sss.pgh.pa.us, pgsql@j-davis.com, robertmhaas@gmail.com, teodor@sigaev.ru, heikki.linnakangas@enterprisedb.com, pgsql-hackers@postgresql.org
  Subject: Re: [PATCHES] GIN improvements
  In-Reply-To: <20441.1234209245@sss.pgh.pa.us>
  References: <483FD205.4090904@sigaev.ru> <1232348905.7281.114.camel@jdavis> <4974B002.3040202@sigaev.ru> <1232474489.23316.8.camel@jdavis> <49770FD4.5030600@sigaev.ru> <1232561271.23793.46.camel@jdavis> <497864DC.5080800@sigaev.ru> <4979BAF8.1000501@sigaev.ru> <16080.1233625091@sss.pgh.pa.us> <1233772747.3805.2.camel@dell.linuxdev.us.dell.com> <603c8f070902041140h35c2aeo8c4ed79cd16400f8@mail.gmail.com> <1233782589.3805.12.camel@dell.linuxdev.us.dell.com> <20441.1234209245@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