pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David Gauthier <dfgpostgres@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: Indexing fragments of a column's value ?
Date: Fri, 03 Nov 2023 16:01:30 -0400
Message-ID: <3334146.1699041690@sss.pgh.pa.us> (raw)
In-Reply-To: <CAEs=6Dm_UsHekAcUUGSLVwAtb+zvfLL+0DVTyB+VyuVFvhPjcQ@mail.gmail.com>
References: <CAEs=6Dm_UsHekAcUUGSLVwAtb+zvfLL+0DVTyB+VyuVFvhPjcQ@mail.gmail.com>

David Gauthier <dfgpostgres@gmail.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





view thread (5+ messages)  latest in thread

Message-ID: <3334146.1699041690@sss.pgh.pa.us>
Permalink:  ../3334146.1699041690@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3334146.1699041690@sss.pgh.pa.us

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, dfgpostgres@gmail.com
  Subject: Re: Indexing fragments of a column's value ?
  In-Reply-To: <3334146.1699041690@sss.pgh.pa.us>
  References: <CAEs=6Dm_UsHekAcUUGSLVwAtb+zvfLL+0DVTyB+VyuVFvhPjcQ@mail.gmail.com> <3334146.1699041690@sss.pgh.pa.us>

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

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