Re: Toast bug in CVS HEAD

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Toast bug in CVS HEAD
Date: 2008-11-05 20:41:50
Message-ID: 2486.1225917710@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com> writes:
> Basically, this comment and code in genam.c:
> ...
> is wrong, because it assumes that there's only one scankey per index
> column, but that's not true for toast_fetch_datum_slice(), which uses
> two scankeys for the chunkid, to fetch a range. Attached is a patch to
> fix that, as suggested in the comment. Comments? I'll apply if not..

Huh, can't believe I missed that that caller might use non-sequential
column numbers.

It's kind of annoying to introduce a search when it's so seldom needed,
though. How about something like

/* fast path for common case */
if (key[i].sk_attno == irel->rd_index->indkey.values[i])
key[i].sk_attno = i + 1;
else
... search as you have it ...

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-11-05 20:44:36 Re: [WIP] In-place upgrade
Previous Message Kenneth Marshall 2008-11-05 20:34:03 Re: [RRR] Tests citext casts