Re: Canonicalization of WHERE clauses considered harmful - Mailing list pgsql-hackers

From Kurt Roeckx
Subject Re: Canonicalization of WHERE clauses considered harmful
Date
Msg-id 20031210221955.GA26735@ping.be
Whole thread Raw
In response to Canonicalization of WHERE clauses considered harmful  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Canonicalization of WHERE clauses considered harmful  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On Wed, Dec 10, 2003 at 04:54:54PM -0500, Tom Lane wrote:
> Currently, this is accomplished by the roundabout method of converting
> the WHERE clause to CNF (AND-of-ORs) and then simplifying duplicate
> sub-clauses within an OR:
>     (a AND b) OR (a AND c)
> expands by repeated application of the distributive law to
>     (a OR a) AND (a OR c) AND (b OR a) AND (b OR c)

This is wrong.

What would be true however is:

(a OR b) AND (b OR C)
= (a AND b) OR (a AND c) OR (b AND b) OR (b AND C)

(Replace AND by * and OR by +)


Kurt



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Canonicalization of WHERE clauses considered harmful
Next
From: Tom Lane
Date:
Subject: Re: Canonicalization of WHERE clauses considered harmful