Re: Inlining of functions (doing LIKE on an array)

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: "ldh(at)laurent-hasson(dot)com" <ldh(at)laurent-hasson(dot)com>
Cc: "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Inlining of functions (doing LIKE on an array)
Date: 2016-11-11 23:32:33
Message-ID: CAMkU=1w+QQofiijZgHziYxhXjz6CNm_CDkRN_Wqif5ijQT6qjQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Thu, Nov 10, 2016 at 10:54 PM, ldh(at)laurent-hasson(dot)com <
ldh(at)laurent-hasson(dot)com> wrote:

> Hello,
>
>
>
> I am trying to implement an efficient “like” over a text[]. I see a lot of
> people have tried before me and I learnt a lot through the forums.
>

Have you looked at parray_gin?

https://github.com/theirix/parray_gin

(Also on PGXN, but I don't know how up-to-date it is there)

Or you could create an regular pg_trgm index on the expression:

array_to_string("ICD9_DGNS_CD",'<some safe delimiter>')

If you can find a safe delimiter to use (one that can't be part of the
text[]).

The performance of these options will depend on both the nature of your
data and the nature of your queries.

Cheers,

Jeff

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message ldh@laurent-hasson.com 2016-11-12 00:41:16 Re: Inlining of functions (doing LIKE on an array)
Previous Message Tom Lane 2016-11-11 16:46:24 Re: Inlining of functions (doing LIKE on an array)