Re: [HACKERS] RE: [GENERAL] Long update query ? (also Re: [GENERAL] CNF vs. DNF)

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: [HACKERS] RE: [GENERAL] Long update query ? (also Re: [GENERAL] CNF vs. DNF)
Дата
Msg-id 199810040332.XAA06650@candle.pha.pa.us
обсуждение исходный текст
Ответ на RE: [HACKERS] RE: [GENERAL] Long update query ? (also Re: [GENERAL] CNF vs. DNF)  ("Taral" <taral@mail.utexas.edu>)
Список pgsql-hackers
[Charset iso-8859-1 unsupported, filtering to ASCII...]
> > however if A and C are identical, this could become:
> >
> >     (A OR A) AND (A OR D) AND (B OR A) AND (B OR D)
> >
> > and A OR A is A:
> >
> >     A AND (A OR D) AND (B OR A) AND (B OR D)
> >
> > and since we are now saying A has to be true, we can remove OR's with A:
> >
> >     A AND (B OR D)
>
> Very nice... and you could do that after each iteration of the rewrite,
> preventing the size from getting too big. :)
>
> I have a symbolic expression tree evaluator that would be perfect for
> this... I'll see if I can't adapt it.
>
> Can someone mail me the structures for expression trees? I don't want to
> have to excise them from the source. Please?

That is very hard to do.  We have lots of structures involved.  I
recommend you look at backend/optimizer/prep/prepqual.c.  That has the
CNF'ify code, and I am studying it now.   There are supporing functions
on backend/nodes that will allow comparisons of many structures.

We may not be that far off.  normalize() does much of the work, and
qual_cleanup() reomves duplicates using remove_duplicates(), but
qual_cleanup() is only called after normalize completes, not during the
normalization, which seems to be the problem.  If we can remove the
duplicates BEFORE the OR explosion, we are much better off.

You can then use ctags to jump around to see the supporting structures.
See the developers FAQ in the web site or doc directory.

--
  Bruce Momjian                        |  http://www.op.net/~candle
  maillist@candle.pha.pa.us            |  (610) 853-3000
  +  If your life is a hard drive,     |  830 Blythe Avenue
  +  Christ can be your backup.        |  Drexel Hill, Pennsylvania 19026


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

Предыдущее
От: Terry Mackintosh
Дата:
Сообщение: Re: [HACKERS] Dumping of views -- done!
Следующее
От: "Thomas G. Lockhart"
Дата:
Сообщение: Re: IP test program