Re: texteq/byteaeq: avoid detoast [REVIEW] - Mailing list pgsql-hackers

From Tom Lane
Subject Re: texteq/byteaeq: avoid detoast [REVIEW]
Date
Msg-id 20347.1295296796@sss.pgh.pa.us
Whole thread Raw
In response to Re: texteq/byteaeq: avoid detoast [REVIEW]  (Magnus Hagander <magnus@hagander.net>)
Responses Re: texteq/byteaeq: avoid detoast [REVIEW]  (Itagaki Takahiro <itagaki.takahiro@gmail.com>)
List pgsql-hackers
Magnus Hagander <magnus@hagander.net> writes:
> I wonder if we can trust the *equality* test, but not the inequality?
> E.g. if compressed(A) == compressed(B) we know they're the same, but
> if compressed(A) != compressed(B) we don't know they're not they still
> might be.

I haven't looked at this patch, but it seems to me that it would be
reasonable to conclude A != B if the va_extsize values in the toast
pointers don't agree.  Once you've fetched the toasted values, you've
spent enough cycles that there's not going to be much point in
trying to do any cute optimizations beyond that.  So if the patch is
doing a memcmp on the compressed data, I'd be inclined to get rid of
that part.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andreas Karlsson
Date:
Subject: Re: psql: Add \dL to show languages
Next
From: Alvaro Herrera
Date:
Subject: Re: log_hostname and pg_stat_activity