Re: [pg_trgm] Making similarity(?, ?) < ? use an index

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Navis <contact(at)gregnavis(dot)com>
Cc: Artur Zakirov <a(dot)zakirov(at)postgrespro(dot)ru>, Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: [pg_trgm] Making similarity(?, ?) < ? use an index
Date: 2016-06-09 14:12:54
Message-ID: 13882.1465481574@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I wrote:
> Greg Navis <contact(at)gregnavis(dot)com> writes:
>> I'm not sure how to make this operator use an index. It seems I need to
>> create an operator class but I'm not sure how.

> What you'd want to do is add it to the existing operator class and then
> teach the class's support functions (mostly, the "consistent" function)
> about it.

BTW, you'd probably find this patch instructive:

https://git.postgresql.org/gitweb/?p=postgresql.git&a=commitdiff&h=f576b17cd6ba653bdace1f0da9a3b57f4984e460

although it's doing more than just adding one operator.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message rob stone 2016-06-09 19:15:25 Re: Automate copy - Postgres 9.2
Previous Message Tom Lane 2016-06-09 13:56:04 Re: [pg_trgm] Making similarity(?, ?) < ? use an index