Tom Lane wrote:
Only two of them are logically equivalent. Consider NULL.
Ohhh IS NOT TRUE or IS NOT FALSE also match NULL, I never knew this :)
Even for the first two, assuming equivalence requires hard-wiring an
assumption about the behavior of the "bool = bool" operator; which is
a user-r
On Thu, 21 Nov 2002, Stephan Szabo wrote:
>
> On Thu, 21 Nov 2002, Christopher Kings-Lynne wrote:
>
> > > > > "col" isn't of the general form "indexkey op constant" or "constant op
> > > > > indexkey" which I presume it's looking for given the comments in
> > > > > indxpath.c. I'm not sure what
Daniele Orlandi <[EMAIL PROTECTED]> writes:
> The problem is the opposite... so, effectively, seems that the optimizer
> considers "monitored" and "monitored=true" as two different expressions...
Check.
> The viceversa is analog and we also can see that the syntax "monitored
> is true" is consi
Stephan Szabo wrote:
On Thu, 21 Nov 2002, Daniele Orlandi wrote:
Are those two syntaxes eqivalent ?
select * from users where monitored;
select * from users where monitored=true;
If the answer is yes, the optimimer probably doesn't agree with you :)
That depends on the definition of equiva
On Thu, 21 Nov 2002, Christopher Kings-Lynne wrote:
> > > > "col" isn't of the general form "indexkey op constant" or "constant op
> > > > indexkey" which I presume it's looking for given the comments in
> > > > indxpath.c. I'm not sure what the best way to make it work would be
> given
> > > >
> > > "col" isn't of the general form "indexkey op constant" or "constant op
> > > indexkey" which I presume it's looking for given the comments in
> > > indxpath.c. I'm not sure what the best way to make it work would be
given
> > > that presumably we'd want to make col IS TRUE/FALSE use an index
> > Not that I see the point of indexing booleans, but hey :)
>
> If one of the values is much more infrequent than the other, you can
> probably get a substantial win using a partial index, can't you?
Yes, I thought of the partial index after I wrote that email :)
Chris
-
On Thu, 21 Nov 2002, Christopher Kings-Lynne wrote:
> > > I think his point is that they _should_ be equivalent. Surely there's
> > > something in the optimiser that discards '=true' stuff, like 'a=a'
> should be
> > > discarded?
> >
> > I figure that's what he meant, but it isn't what was said.
On Thu, 21 Nov 2002, Christopher Kings-Lynne wrote:
> > > I think his point is that they _should_ be equivalent. Surely there's
> > > something in the optimiser that discards '=true' stuff, like 'a=a'
> should be
> > > discarded?
> >
> > I figure that's what he meant, but it isn't what was said.
On Thu, Nov 21, 2002 at 02:45:34PM -0800, Christopher Kings-Lynne wrote:
> > > I think his point is that they _should_ be equivalent. Surely there's
> > > something in the optimiser that discards '=true' stuff, like 'a=a'
> should be
> > > discarded?
> Not that I see the point of indexing boolean
> > I think his point is that they _should_ be equivalent. Surely there's
> > something in the optimiser that discards '=true' stuff, like 'a=a'
should be
> > discarded?
>
> I figure that's what he meant, but it isn't what was said. ;)
>
> "col" isn't of the general form "indexkey op constant" or
On Thu, 21 Nov 2002, Christopher Kings-Lynne wrote:
> > > Are those two syntaxes eqivalent ?
> > >
> > > select * from users where monitored;
> > > select * from users where monitored=true;
> > >
> > > If the answer is yes, the optimimer probably doesn't agree with you :)
> >
> > That depends on
> > Are those two syntaxes eqivalent ?
> >
> > select * from users where monitored;
> > select * from users where monitored=true;
> >
> > If the answer is yes, the optimimer probably doesn't agree with you :)
>
> That depends on the definition of equivalent. They presumably give the
> same answer
On Thu, 21 Nov 2002, Daniele Orlandi wrote:
> Are those two syntaxes eqivalent ?
>
> select * from users where monitored;
> select * from users where monitored=true;
>
> If the answer is yes, the optimimer probably doesn't agree with you :)
That depends on the definition of equivalent. They pres
Using the famous WAG tech, in your first query the optimizer has to
evaluate monitored for each record to determine its value.
Robert Treat
On Thu, 2002-11-21 at 13:39, Daniele Orlandi wrote:
>
> Are those two syntaxes eqivalent ?
>
> select * from users where monitored;
> select * from users w
Are those two syntaxes eqivalent ?
select * from users where monitored;
select * from users where monitored=true;
If the answer is yes, the optimimer probably doesn't agree with you :)
Tested on RC1:
template1=# create table a (a boolean, b text);
CREATE TABLE
inserted ~18000 rows with
16 matches
Mail list logo