Search Postgresql Archives

Re: gin index postgres 9.2

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 25, 2016 at 8:09 PM, Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
"David G. Johnston" <david.g.johnston@xxxxxxxxx> writes:
> On Wed, May 25, 2016 at 7:42 PM, David G. Johnston <
> david.g.johnston@xxxxxxxxx> wrote:
>> ​What's the query with the revised parentheses?

> ​Never mind...your right I doubt that it should matter.

The parentheses in the original *definitely* matter, because by default
AND binds more tightly than OR.  The larger number of rows in the second
query are perfectly plausible given the parenthesis-omission.

​That's what I get for second-guessing myself...

To be more precise the behavior shown is exhibited in the following three queries.

SELECT true OR false OR false AND false AND false  --> true
SELECT true OR false OR (false AND false AND false) -->true
or, more precisely:
SELECT (true OR false) OR ((false AND false) AND false) -->true

what is thus needed is:
SELECT (true OR false OR false) AND false AND false --> false
which is treated like
SELECT (((true OR false) OR false) AND false) AND false --> false

penance served...

David J.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux