Re: texteq/byteaeq: avoid detoast

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Noah Misch <noah(at)leadboat(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: texteq/byteaeq: avoid detoast
Date: 2011-01-04 03:23:03
Message-ID: AANLkTinBFfeWxcaW8=4fcL72ErUoHA+KuTxYbbr+3mZ_@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Dec 20, 2010 at 1:19 PM, Noah Misch <noah(at)leadboat(dot)com> wrote:
> texteq, textne, byteaeq and byteane detoast their arguments, then check for
> equality of length.  Unequal lengths imply the answer trivially; given equal
> lengths, the functions proceed to compare the actual bytes.  We can skip
> detoasting entirely when the lengths are unequal.  The attached patch implements
> this.  As submitted, it applies atop of my recent strncmp->memcmp patch, but
> they are logically independent.  To benchmark some optimal and pessimal cases, I
> used the attached "bench-skip-texteq.sql".  It uses a few datum sizes and varies
> whether the length check succeeds:
>
> bench-skip-texteq.sql, 10 MiB nomatch: 58.4s previous, 0.00664s patched
> bench-skip-texteq.sql,  144 B   match: 73.0s previous, 71.9s patched
> bench-skip-texteq.sql,    3 B   match: 68.8s previous, 67.3s patched
> bench-skip-texteq.sql,    3 B nomatch: 45.0s previous, 46.0s patched
>
> The timing differences in the smaller-length test cases are probably not
> statistically significant.

Can you add this to the currently-open CommitFest, so we don't lose track of it?

https://commitfest.postgresql.org/action/commitfest_view/open

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2011-01-04 03:25:22 Re: [PATCH] V3: Idle in transaction cancellation
Previous Message Robert Haas 2011-01-04 03:21:07 Re: SSPI client authentication in non-Windows builds