Re: comparing index columns - Mailing list pgsql-hackers

From Tom Lane
Subject Re: comparing index columns
Date
Msg-id 9123.1181741806@sss.pgh.pa.us
Whole thread Raw
In response to Re: comparing index columns  (Heikki Linnakangas <heikki@enterprisedb.com>)
List pgsql-hackers
Heikki Linnakangas <heikki@enterprisedb.com> writes:
> How about just doing a memcmp? That would be safe, simple and fast and 
> covers all interesting use cases.

You'd have to use datumIsEqual() or equivalent, and figure out what to
do about nulls.  I think it'd work though, at least for the purposes
that HOT needs.  There are failure cases; for example a previously
not-toasted index key column could get toasted due to expansion of an
unrelated data column.  But +1 for speed over accuracy here, as long as
it can never make a false equality report.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Heikki Linnakangas
Date:
Subject: Re: EXPLAIN omits schema?
Next
From: Alvaro Herrera
Date:
Subject: Re: DROP TABLE and autovacuum