Skip site navigation (1) Skip section navigation (2)

Re: temporary tables, indexes, and query plans

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Jon Nelson <jnelson+pgsql(at)jamponi(dot)net>, pgsql-performance(at)postgresql(dot)org
Subject: Re: temporary tables, indexes, and query plans
Date: 2010-11-14 15:55:05
Message-ID: 10597.1289750105@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-performance
Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> Yeah, I'm not familiar with the logic in that area of the code, so I
> can't comment all that intelligently.  However, I feel like there's a
> class of things that could potentially be optimized if we know that
> the only snapshot they could affect is the one we're currently using.

Yeah, perhaps.  The other thing I noticed while looking at the code is
that CREATE INDEX's test to see whether there are broken HOT chains is
borderline brain-dead: if there are any recently-dead HOT-updated tuples
in the table, it assumes they represent broken HOT chains, whether they
really do or not.  In principle you could find the live member of the
chain and see whether or not it is really different from the dead member
in the columns used by the new index.  In Jon's example that would win
because his update didn't actually change the indexed column.  It's
unclear though that it would be useful often enough to be worth the
extra code and cycles.

			regards, tom lane

In response to

pgsql-performance by date

Next:From: Robert HaasDate: 2010-11-14 23:00:58
Subject: Re: Why dose the planner select one bad scan plan.
Previous:From: Marti RaudseppDate: 2010-11-14 09:47:16
Subject: Re: Defaulting wal_sync_method to fdatasync on Linux for 9.1?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group