Re: Indexing fragments of a column's value ?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: David Gauthier <dfgpostgres(at)gmail(dot)com>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: Indexing fragments of a column's value ?
Date: 2023-11-03 20:01:30
Message-ID: 3334146.1699041690@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

David Gauthier <dfgpostgres(at)gmail(dot)com> writes:
> I'm asking about the possibility of indexing portions of a column's value
> where the column has a static field format.

GIN indexes are meant for exactly that. You might have to write your
own opclass to break up the input values in the way you want though.

A less difficult answer would be to write a function that breaks up
the input into (say) an array of text and then use the existing
GIN array support. But you'd pay for that by needing to write more
complicated queries to use the index.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Thomas Boussekey 2023-11-03 21:07:58 Re: Indexing fragments of a column's value ?
Previous Message Tom Lane 2023-11-03 19:58:05 Re: Local postgres manual