From: W.Alphonse HAROUNY <wharouny@gmail.com>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Kevin Grittner <Kevin.Grittner@wicourts.gov>
Cc: valgog <valgog@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Index usage when bitwise operator is used
Date: Mon, 17 Sep 2007 16:40:49 +0200
Message-ID: <f97d4e240709170740g57c2169kaf8808339399b8bf@mail.gmail.com> (raw)
In-Reply-To: <21403.1190036229@sss.pgh.pa.us>
References: <f97d4e240709130530ve3cc522g61ccca23335618f4@mail.gmail.com>
<46ED7CCD.EE98.0025.0@wicourts.gov>
<1190015368.148293.56830@y42g2000hsy.googlegroups.com>
<46EE2C53.EE98.0025.0@wicourts.gov>
<21403.1190036229@sss.pgh.pa.us>
Hi,
A little clarification. Actually, TBL1.CATEGORY and/or TBL2.CATEGORY may
hold a binary value having multiple binary(ies) '1'.
Each binary value column represent an business attribute.
If a binary value column is equal to '1', it means that the business
attribute is True,
otherwise it is false.
I adopted this avoid defining a detail table to table TBL1. Idem to TBL2.
If TBL1.CATEGORY | TBL2.CATEGORY > 0
=> it means that we have at least one common business attribute that is TRUE
for TBL1 and TBL2.
Regards
W.Alf
On 9/17/07, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> "Kevin Grittner" <Kevin.Grittner@wicourts.gov> writes:
> > On Mon, Sep 17, 2007 at 2:49 AM, in message
> > <1190015368.148293.56830@y42g2000hsy.googlegroups.com>, valgog
> > <valgog@gmail.com> wrote:=20
> >> Are you sure you understood what was the question?
> >>
> >> Is the TBL1.CATEGORY = TBL2.CATEGORY the same as TBL1.CATEGORY &
> >> TBL2.CATEGORY > 0?
>
> > Yes, given that he stipulated that one and only one bit would be set.
>
> Really? In that case, isn't this bit-field just a bad implementation of
> an enum-style field?
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
>
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 using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: wharouny@gmail.com, tgl@sss.pgh.pa.us, Kevin.Grittner@wicourts.gov, valgog@gmail.com
Subject: Re: Index usage when bitwise operator is used
In-Reply-To: <f97d4e240709170740g57c2169kaf8808339399b8bf@mail.gmail.com>
* 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