pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Sean Chittenden <sean@chittenden.org>
Cc: Josh Berkus <josh@agliodbs.com>
Cc: Don Bowman <don@sandvine.com>
Cc: 'pgsql-hackers@postgresql.org' <pgsql-hackers@postgresql.org>
Subject: Re: [PERFORM] not using index for select min(...)
Date: Fri, 31 Jan 2003 23:35:32 -0500
Message-ID: <4278.1044074132@sss.pgh.pa.us> (raw)
In-Reply-To: <20030201040954.GK15936@perrin.int.nxad.com>
References: <FE045D4D9F7AED4CBFF1B3B813C8533701023616@mail.sandvine.com>
	<200301311531.12605.josh@agliodbs.com>
	<20030201040954.GK15936@perrin.int.nxad.com>

Sean Chittenden <sean@chittenden.org> writes:
> Now, there are some obvious problems:

You missed the real reason why this will never happen: it completely
kills any prospect of concurrent updates.  If transaction A has issued
an update on some row, and gone and modified the relevant aggregate
cache entries, what happens when transaction B wants to update another
row?  It has to wait for A to commit or not, so it knows whether to
believe A's changes to the aggregate cache entries.

For some aggregates you could imagine an 'undo' operator to allow
A's updates to be retroactively removed even after B has applied its
changes.  But that doesn't work very well in general.  And in any case,
you'd have to provide serialization interlocks on physical access to
each of the aggregate cache entries.  That bottleneck applied to every
update would be likely to negate any possible benefit from using the
cached values.

			regards, tom lane



view thread (12+ messages)  latest in thread

Message-ID: <4278.1044074132@sss.pgh.pa.us>
Permalink:  ../4278.1044074132@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/4278.1044074132@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-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, sean@chittenden.org, josh@agliodbs.com, don@sandvine.com, pgsql-hackers@postgresql.org
  Subject: Re: [PERFORM] not using index for select min(...)
  In-Reply-To: <4278.1044074132@sss.pgh.pa.us>
  References: <FE045D4D9F7AED4CBFF1B3B813C8533701023616@mail.sandvine.com> <200301311531.12605.josh@agliodbs.com> <20030201040954.GK15936@perrin.int.nxad.com> <4278.1044074132@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