Apply the heuristic proposed by Taral (see pgsql-general archives for
Tom Lane <tgl@sss.pgh.pa.us>
Apply the heuristic proposed by Taral (see pgsql-general archives for 2-Oct-98 or TODO.detail/cnfify) to decide whether we want to reduce WHERE clause to CNF form, DNF form, or neither. This is a HUGE win. The heuristic conditions could probably still use a little tweaking to make sure we don't pick CNF when DNF would be better, or vice versa, but the risk of exponential explosion in cnfify() is gone. I was able to run ten-thousand-AND-subclause queries through the planner in a reasonable amount of time.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/optimizer/prep/prepqual.c | modified | +106 −53 |