Re: Canonicalization of WHERE clauses considered harmful

Поиск
Список
Период
Сортировка
От Kurt Roeckx
Тема Re: Canonicalization of WHERE clauses considered harmful
Дата
Msg-id 20031210225813.GA27230@ping.be
обсуждение исходный текст
Ответ на Re: Canonicalization of WHERE clauses considered harmful  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Wed, Dec 10, 2003 at 05:35:11PM -0500, Tom Lane wrote:
> Kurt Roeckx <Q@ping.be> writes:
> > On Wed, Dec 10, 2003 at 04:54:54PM -0500, Tom Lane wrote:
> >> (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.
> 
> I don't think so.  The distributive law is
> 
>     a OR (b AND c) == (a OR b) AND (a OR c)

Oh, I was reading it wrong.

So basicly it makes a + bc = (a+b)*(a+c) = a + ab + ac + bc
And ab + ac = a * (a+b) * (a+c) * (b+c) = ab + abc + ac


(This is so much easier to read then using AND and OR.)


Kurt



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Jason Tishler
Дата:
Сообщение: Re: postgres panic error
Следующее
От: David Fetter
Дата:
Сообщение: CSV hack