> (A AND B) OR (C AND D) ==> (A AND B) UNION (C AND D)
>
> The rules to qualify are fairly strict. Must be have ANDs; rectangular in
> shape; all (VAR op CONST) type nodes; minimum of 10 nodes; etc. I was
> targeting the keysets queries generated by ODBC tools.
>
> As for the current direction this thread is going, (factoring) I have one
> word of caution. PREPARE. If you take this route, you will never be able
> to implement a workable PREPARE statement. I believe that in order for
> PostgrerSQL ever become a industrial strength client/server it must implement
> a PREPARE statement with parameters.
I see that adding nodes it going to mess up prepare, but we already add
extra nodes as part of part of "col in (1, 2, 3)."
I think the PARAM's we already use will be duplicated/removed and still
retain their values for substitution. They just may be in a different
order.
--
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