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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-performance by date

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