public inbox for [email protected]  
help / color / mirror / Atom feed
From: David G. Johnston <[email protected]>
To: Zach Aysan <[email protected]>
Cc: Pg Docs <[email protected]>
Subject: Re: Reverse btree indexes
Date: Tue, 22 Jun 2021 15:51:23 -0700
Message-ID: <CAKFQuwYsDe8gVLL66oSDKbDZ6Ln72ygDp=R2CPfd7Ri7acRPkg@mail.gmail.com> (raw)
In-Reply-To: <CABYkO2Bfg6sJviiOCBze0fJ5720Oo3VjRnVtVNKM-0i0exALVg@mail.gmail.com>
References: <CABYkO2Bfg6sJviiOCBze0fJ5720Oo3VjRnVtVNKM-0i0exALVg@mail.gmail.com>

On Tue, Jun 22, 2021 at 2:28 PM Zach Aysan <[email protected]> wrote:

> *Desired improvement:*
>
>  for example, col LIKE 'foo%' or col ~ '^foo', but not col LIKE '%bar',
>> which would require a reversed index on the field. Postgres will
>> automatically use the reverse index for LIKE '%bar'
>
>
> *Or if it doesn't:*
>

It doesn't, otherwise the documentation wouldn't need to point out: but not
col LIKE '%bar' ...


>
>> for example, col LIKE 'foo%' or col ~ '^foo', but not col LIKE '%bar',
>> which would require a reversed index on the field. To use the reversed
>> index, query with reverse(col) like reverse('%bar').
>
>
>
This type of commentary isn't usually something we include in the
documentation...and I'm not too keen on "reversed index" as a phrase
regardless.

David J.


reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Reverse btree indexes
  In-Reply-To: <CAKFQuwYsDe8gVLL66oSDKbDZ6Ln72ygDp=R2CPfd7Ri7acRPkg@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox