Re: Reverse btree indexes

2021-06-23 Thread Alvaro Herrera
On 2021-Jun-22, David G. Johnston wrote: > On Tue, Jun 22, 2021 at 2:28 PM Zach Aysan wrote: > >> 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('%

Re: Reverse btree indexes

2021-06-22 Thread David G. Johnston
On Tue, Jun 22, 2021 at 2:28 PM Zach Aysan 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

Reverse btree indexes

2021-06-22 Thread Zach Aysan
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