Re: operators, operator classes, Btree and index usage

From: "Sergey E(dot) Koposov" <math(at)sai(dot)msu(dot)ru>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: operators, operator classes, Btree and index usage
Date: 2005-09-02 22:53:22
Message-ID: Pine.LNX.4.44.0509030238510.20863-100000@lnfm1.sai.msu.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, 2 Sep 2005, Tom Lane wrote:

> "Sergey E. Koposov" <math(at)sai(dot)msu(dot)ru> writes:
> > I'm interested in simplifying those queries and introducing the operator
> > doing something like this:
>
> > my_operator(bigint x, bigint[] arr)
> > checking the condition:
> > ((x>arr[1]) AND (x<arr[2])) OR ((x>arr[3]) AND (x<arr[4]))
>
> This could be made to work if you define the above as an inline-able SQL
> function. Hacking operator classes won't do it though.

Thank you, Tom! Great! I didn't know that Postgres can inline the SQL
functions (In fact this is because the only place in the documentation
mentioning about inlining SQL functions is the changelog of the
postgres 7.4 :).

With Best Regards,
Sergey

*****************************************************
Sergey E. Koposov
Max-Planck Institut fuer Astronomie
Web: http://lnfm1.sai.msu.ru/~math
E-mail: math(at)sai(dot)msu(dot)ru

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Hrishikesh Deshmukh 2005-09-02 23:16:04 Re: Schema overlay question
Previous Message Michael Fuhr 2005-09-02 22:05:22 Re: Schema overlay question