Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lvnzs-0002iT-PJ for pgsql-docs@arkaria.postgresql.org; Tue, 22 Jun 2021 21:31:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lvnzq-0002a2-El for pgsql-docs@arkaria.postgresql.org; Tue, 22 Jun 2021 21:31:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lvlQX-0001Hm-C8 for pgsql-docs@lists.postgresql.org; Tue, 22 Jun 2021 18:47:13 +0000 Received: from mail-pg1-x529.google.com ([2607:f8b0:4864:20::529]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lvlQQ-0006WD-Ot for pgsql-docs@lists.postgresql.org; Tue, 22 Jun 2021 18:47:13 +0000 Received: by mail-pg1-x529.google.com with SMTP id t9so17835474pgn.4 for ; Tue, 22 Jun 2021 11:47:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=3XMckZGDZKZRaVn0anzkLAk0MZwZLA1kXmohHagDWx0=; b=KaIftoF6y7c5pNv29FkDOEdqfGO6+HNuEAeoqQ3vtaj5xG05xGTCbq1QXl/lAmVG/B HIPD55MChiT2H0m6R+zXXKU2p8OG5XKttfruCHJSH0qAj4phjPjR+3ZszK72Ba+HZGS6 /mR4aZ481T86XVHlzriRQETdAAYy5V6orTKjPU/i0S8KDwcO8hI8hCPiiPGTVW/GPT8s RK7PRlHVLQLBjdl9E8E8+aSsOafLCu21v435KcBkyXr9h00mo32QA3sRbHQ8D8BrGUeC tgQNpSmki4EL4OMK7E72Oz2uFYN76E5Mgr264BMV1Cp0qjvXXdxETcz0adIk7VDy/fEb /1jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=3XMckZGDZKZRaVn0anzkLAk0MZwZLA1kXmohHagDWx0=; b=SWz2pk7DcQLSAMksxPXa0hWfKAlV7+gwuEkToS8iXB7c93XRHYOarqulNCQ3M2xXFr vKEOeOSJmBdDEG1xfh/aB1LFTgdmNEYxG6VvBCey1351RPXo4UTPVeXIswf+oApwO/XB N6i5lWHLO434p5dh7YQ6eOxNybNneBYGuulNhGY3I+S89WszwyQKgArsgT5Hv7vQ3i0m jO7m9afIeeYKbFyxm5Fi0a0RxpUCWqGL+djII0Mh+jdwNRYqmriM/I5ac/bWz2gHy/tL FRqhv62vB9C2OCS8Z7EsYxfMbQUHdajUMWJC8PcszmyXc3iHnJi8Pje6rEVNvFJ5IJtO S4yA== X-Gm-Message-State: AOAM531PvnbhhSLyjkD2hyWbz2SUxC3bS1L0QnU5v91/GzXhVVvi/T9b U7HesNY5dj3W32BTlm1iwLlKSmVQiXXLqopPOsKk/PGWSrLb X-Google-Smtp-Source: ABdhPJwo8TTcIYoO7QkDRvVUG42mL6KCTaNyX7qG1oSRyvMurA4tcOFvm3xLdAwdLV5OYvxJADjEssbcX3omMwHpWms= X-Received: by 2002:a05:6a00:1a50:b029:305:7cd3:ab35 with SMTP id h16-20020a056a001a50b02903057cd3ab35mr4035914pfv.31.1624387623819; Tue, 22 Jun 2021 11:47:03 -0700 (PDT) MIME-Version: 1.0 From: Zach Aysan Date: Tue, 22 Jun 2021 14:46:52 -0400 Message-ID: Subject: Reverse btree indexes To: pgsql-docs@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000004b9e1605c55f3785" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000004b9e1605c55f3785 Content-Type: text/plain; charset="UTF-8" Hey there! Thanks for putting together such wonderful documentation. I have a small suggestion for improvement. *Page:* https://www.postgresql.org/docs/13/indexes-types.html *Existing language:* for example, col LIKE 'foo%' or col ~ '^foo', but not col LIKE '%bar'. *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:* > 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'). I hope you all have a great day! Zach --0000000000004b9e1605c55f3785 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hey there! Thanks for putting together such wonderful= documentation. I have a small suggestion for improvement.

Page: https://www.postgresql.org/docs/13/indexes-types.html
=C2=A0
Existing language:

for example, col LIKE 'foo%= ' or col ~ '^foo', but not col LIKE '%bar'.

Desired improvement:

=C2=A0for example, col LIKE = 9;foo%' or col ~ '^foo', but not col LIKE '%bar', which= would require a reversed index on the field. Postgres will automatically u= se the reverse index for LIKE '%bar'

Or if it doesn't:
=C2=A0
for example, col LIKE 'foo%' or col ~ &= #39;^foo', but not col LIKE '%bar', which would require a rever= sed index on the field. To use the reversed index, query with=C2=A0reverse(col) like reverse('%bar'= ).
=

I hope you all have a great day!

Zach
=C2=A0
--0000000000004b9e1605c55f3785--