Re: [HACKERS] Duplicate index check in btbuild - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [HACKERS] Duplicate index check in btbuild
Date
Msg-id 9990.949334457@sss.pgh.pa.us
Whole thread Raw
In response to Duplicate index check in btbuild  ("Hiroshi Inoue" <Inoue@tpf.co.jp>)
Responses RE: [HACKERS] Duplicate index check in btbuild
List pgsql-hackers
"Hiroshi Inoue" <Inoue@tpf.co.jp> writes:
> In addition I could find no other place to check
> index uniqueness in tuplesort.c .
> Seems we have to give up the uniqueness check in comparetup_
> index() and have to check it in _bt_buildadd().

Checking index uniqueness in tuplesort is pretty much of a hack,
although kind of cool since it doesn't take any extra comparisons
to do it there.  But if we're doing the wrong thing then it has
to be removed.

I'm a little unclear on *why* it's wrong though.  Don't we grab an
exclusive lock on a table while building an index for it?  (If not,
shouldn't we be doing so?)  I don't see how there can be tuples of
uncertain commit state that need to be included in the index.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: [HACKERS] float4 confused as int??
Next
From: Ed Loehr
Date:
Subject: Re: [HACKERS] float4 confused as int??