Re: texteq/byteaeq: avoid detoast [REVIEW]
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Magnus Hagander <magnus@hagander.net>
Cc: Itagaki Takahiro <itagaki.takahiro@gmail.com>, KaiGai Kohei <kaigai@ak.jp.nec.com>, Andy Colson <andy@squeakycode.net>, Noah Misch <noah@leadboat.com>, pgsql-hackers@postgresql.org
Date: 2011-01-17T20:39:56Z
Lists: 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