Re: Compressed TOAST Slicing

From: Paul Ramsey <pramsey(at)cleverelephant(dot)ca>
To: Daniel Verite <daniel(at)manitou-mail(dot)org>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, rafia(dot)sabih(at)enterprisedb(dot)com, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Stephen Frost <sfrost(at)snowman(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Compressed TOAST Slicing
Date: 2019-02-20 18:55:19
Message-ID: CACowWR22CBAGP-9tWiKxns3DcpQ55TT-K1W0xeWP7LBGon4PSQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Feb 20, 2019 at 10:50 AM Daniel Verite <daniel(at)manitou-mail(dot)org> wrote:
>
> Paul Ramsey wrote:
>
> > Oddly enough, I couldn't find many/any things that were sensitive to
> > left-end decompression. The only exception is "LIKE this%" which
> > clearly would be helped, but unfortunately wouldn't be a quick
> > drop-in, but a rather major reorganization of the regex handling.
>
> What about starts_with(string, prefix)?
>
> text_starts_with(arg1,arg2) in varlena.c does a full decompression
> of arg1 when it could limit itself to the length of the smaller arg2:

Nice catch, I didn't find that one as it's not user visible, seems to
be only called in spgist (!!)
./backend/access/spgist/spgtextproc.c:
DatumGetBool(DirectFunctionCall2(text_starts_with

Thanks, I'll add that.

P

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2019-02-20 18:55:52 BRIN summarize autovac_report_workitem passes datname as relname
Previous Message Joe Conway 2019-02-20 18:51:57 Re: BUG #15646: Inconsistent behavior for current_setting/set_config