Re: using index on comparison with bit-operation?

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Bruno Wolff III <bruno(at)wolff(dot)to>
Cc: Michael Groth <geek_1981(at)yahoo(dot)de>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: using index on comparison with bit-operation?
Date: 2004-04-08 22:59:51
Message-ID: 200404082259.i38Mxph02515@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Bruno Wolff III wrote:
> On Wed, Apr 07, 2004 at 06:01:03 -0700,
> Michael Groth <geek_1981(at)yahoo(dot)de> wrote:
> > hi,
> >
> > is it possible to use an index on the expression '(table_1.field &
> > table_2.field)::int > 0' ?
> >
> > here's the whole query:
> >
> > SELECT
> > COUNT(*)
> > FROM
> > users AS users
> > JOIN
> > search_profile AS search_profile ON
> > (search_profile.bin_matching_field_0 &
> > users.bin_matching_field_0)::int > 0
> > WHERE
> > users.id = 190
>
> In 7.4 you can create indexes on expressions.

But it uses two different tables. You can't mix tables in an index, can
you?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Kevin Brown 2004-04-09 01:52:59 Re: Function to kill backend
Previous Message Bruce Momjian 2004-04-08 21:45:14 Re: using index on comparison with bit-operation?