summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/prep/prepqual.c
Commit message (Collapse)AuthorAgeFilesLines
* Update copyright for the year 2010.Bruce Momjian2010-01-021-2/+2
|
* Update copyright for 2009.Bruce Momjian2009-01-011-2/+2
|
* Extend the parser location infrastructure to include a location field inTom Lane2008-08-281-1/+3
| | | | | | | | | | | | | most node types used in expression trees (both before and after parse analysis). This allows us to place an error cursor in many situations where we formerly could not, because the information wasn't available beyond the very first level of parse analysis. There's a fair amount of work still to be done to persuade individual ereport() calls to actually include an error location, but this gets the initdb-forcing part of the work out of the way; and the situation is already markedly better than before for complaints about unimplementable implicit casts, such as CASE and UNION constructs with incompatible alternative data types. Per my proposal of a few days ago.
* Update copyrights in source tree to 2008.Bruce Momjian2008-01-011-2/+2
|
* Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian2007-01-051-2/+2
| | | | back-stamped for this.
* pgindent run for 8.2.Bruce Momjian2006-10-041-5/+5
|
* Remove 576 references of include files that were not needed.Bruce Momjian2006-07-141-2/+1
|
* Update copyright for 2006. Update scripts.Bruce Momjian2006-03-051-2/+2
|
* Teach push_nots() how to negate a ScalarArrayOpExpr. In passing, saveTom Lane2005-11-261-6/+35
| | | | a palloc or two in the OpExpr case.
* Re-run pgindent, fixing a problem where comment lines after a blankBruce Momjian2005-11-221-4/+4
| | | | | | | | | comment line where output as too long, and update typedefs for /lib directory. Also fix case where identifiers were used as variable names in the backend, but as typedefs in ecpg (favor the backend for indenting). Backpatch to 8.1.X.
* Standard pgindent run for 8.1.Bruce Momjian2005-10-151-31/+30
|
* Fix an oversight I introduced on 2003-12-28: find_nots/push_nots shouldTom Lane2005-07-291-19/+10
| | | | | | | | | continue to recurse after eliminating a NOT-below-a-NOT, since the contained subexpression will now be part of the top-level AND/OR structure and so deserves to be simplified. The real-world impact of this is probably minimal, since it'd require at least three levels of NOT to make a difference, but it's still a bug. Also remove some redundant tests for NULL subexpressions.
* Rethink the order of expression preprocessing: eval_const_expressionsTom Lane2005-03-281-103/+24
| | | | | | | | | | really ought to run before canonicalize_qual, because it can now produce forms that canonicalize_qual knows how to improve (eg, NOT clauses). Also, because eval_const_expressions already knows about flattening nested ANDs and ORs into N-argument form, the initial flatten_andors pass in canonicalize_qual is now completely redundant and can be removed. This doesn't save a whole lot of code, but the time and palloc traffic eliminated is a useful gain on large expression trees.
* Tag appropriate files for rc3PostgreSQL Daemon2004-12-311-2/+2
| | | | | | | | Also performed an initial run through of upgrading our Copyright date to extend to 2005 ... first run here was very simple ... change everything where: grep 1996-2004 && the word 'Copyright' ... scanned through the generated list with 'less' first, and after, to make sure that I only picked up the right entries ...
* Fix mistaken comment.Tom Lane2004-09-011-2/+2
|
* Pgindent run for 8.0.Bruce Momjian2004-08-291-30/+35
|
* Update copyright to 2004.Bruce Momjian2004-08-291-2/+2
|
* Just about there on de-FastList-ification.Tom Lane2004-06-011-85/+73
|
* Use the new List API function names throughout the backend, and disable theNeil Conway2004-05-301-12/+12
| | | | | list compatibility API by default. While doing this, I decided to keep the llast() macro around and introduce llast_int() and llast_oid() variants.
* Reimplement the linked list data structure used throughout the backend.Neil Conway2004-05-261-25/+25
| | | | | | | | | | | | | | | | In the past, we used a 'Lispy' linked list implementation: a "list" was merely a pointer to the head node of the list. The problem with that design is that it makes lappend() and length() linear time. This patch fixes that problem (and others) by maintaining a count of the list length and a pointer to the tail node along with each head node pointer. A "list" is now a pointer to a structure containing some meta-data about the list; the head and tail pointers in that structure refer to ListCell structures that maintain the actual linked list of nodes. The function names of the list API have also been changed to, I hope, be more logically consistent. By default, the old function names are still available; they will be disabled-by-default once the rest of the tree has been updated to use the new API names.
* Instead of trying to force WHERE clauses into CNF or DNF normal form,Tom Lane2003-12-301-522/+176
| | | | | | | | just look for common clauses that can be pulled out of ORs. Per recent discussion, extracting common clauses seems to be the only really useful effect of normalization, and if we do it explicitly then we can avoid cluttering the qual with partially-redundant duplicated expressions, which was an unpleasant side-effect of the old approach.
* Clean up the usage of canonicalize_qual(): in particular, be consistentTom Lane2003-12-281-112/+74
| | | | | | | | | about whether it is applied before or after eval_const_expressions(). I believe there were some corner cases where the system would fail to recognize that a partial index is applicable because of the previous inconsistency. Store normal rather than 'implicit AND' representations of constraints and index predicates in the catalogs. initdb forced due to representation change of constraints/predicates.
* $Header: -> $PostgreSQL Changes ...PostgreSQL Daemon2003-11-291-1/+1
|
* Another pgindent run with updated typedefs.Bruce Momjian2003-08-081-9/+9
|
* Update copyrights to 2003.Bruce Momjian2003-08-041-2/+2
|
* pgindent run.Bruce Momjian2003-08-041-9/+9
|
* Fix some planner performance problems with large WHERE clauses, byTom Lane2003-05-281-85/+98
| | | | | | | introducing new 'FastList' list-construction subroutines to use in hot spots. This avoids the O(N^2) behavior of repeated lappend's by keeping a tail pointer, while not changing behavior by reversing list order as the lcons() method would do.
* Phase 2 of read-only-plans project: restructure expression-tree nodesTom Lane2002-12-121-54/+47
| | | | | | | | | so that all executable expression nodes inherit from a common supertype Expr. This is somewhat of an exercise in code purity rather than any real functional advance, but getting rid of the extra Oper or Func node formerly used in each operator or function call should provide at least a little space and speed improvement. initdb forced by changes in stored-rules representation.
* Remove sys/types.h in files that include postgres.h, and hence c.h,Bruce Momjian2002-09-021-2/+1
| | | | because c.h has sys/types.h.
* Update copyright to 2002.Bruce Momjian2002-06-201-2/+2
|
* Get rid of long-since-vestigial Iter node type, in favor of adding aTom Lane2002-05-121-2/+3
| | | | | | | returns-set boolean field in Func and Oper nodes. This allows cleaner, more reliable tests for expressions returning sets in the planner and parser. For example, a WHERE clause returning a set is now detected and complained of in the parser, not only at runtime.
* pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian2001-10-251-7/+1
| | | | tests pass.
* pgindent run. Make it all clean.Bruce Momjian2001-03-221-9/+13
|
* Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian2001-01-241-2/+2
|
* Remove 'func_tlist' from Func expression nodes, likewise 'param_tlist'Tom Lane2000-08-081-3/+2
| | | | | | | | from Param nodes, per discussion a few days ago on pghackers. Add new expression node type FieldSelect that implements the functionality where it's actually needed. Clean up some other unused fields in Func nodes as well. NOTE: initdb forced due to change in stored expression trees for rules.
* Mark functions as static and ifdef NOT_USED as appropriate.Bruce Momjian2000-06-081-2/+4
|
* Repair bug reported by Wickstrom: backend would crash if WHERE clauseTom Lane2000-04-141-9/+42
| | | | | | | | | | | | contained a sub-SELECT nested within an AND/OR tree that cnfify() thought it should rearrange. Same physical sub-SELECT node could end up linked into multiple places in resulting expression tree. This is harmless for most node types, but not for SubLink. Repair bug by making physical copies of subexpressions that get logically duplicated by cnfify(). Also, tweak the heuristic that decides whether it's a good idea to do cnfify() --- we don't really want that to happen when it would cause multiple copies of a subselect to be generated, I think.
* Ye-old pgindent run. Same 4-space tabs.Bruce Momjian2000-04-121-84/+116
|
* Avoid a little bit of unnecessary computation in canonicalize_qual.Tom Lane2000-02-271-2/+3
|
* Apply the heuristic proposed by Taral (see pgsql-general archives forTom Lane2000-01-281-53/+106
| | | | | | | | | | 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.
* Add:Bruce Momjian2000-01-261-2/+3
| | | | | | * Portions Copyright (c) 1996-2000, PostgreSQL, Inc to all files copyright Regents of Berkeley. Man, that's a lot of files.
* First cut at doing something reasonable with OR-of-ANDs WHERETom Lane1999-09-131-10/+220
| | | | | | | | conditions. There are some pretty bogus heuristics in prepqual.c that try to decide whether to output CNF or DNF format; they need to be replaced, likely. Right now the code is probably too willing to choose DNF form, which might hurt performance in some cases that used to work OK. But at least we have a foundation to build on.
* Further improvements in cnfify: reduce amount of self-recursionTom Lane1999-09-121-332/+381
| | | | | | | | | in or_normalize, remove detection of duplicate subexpressions (since it's highly unlikely to be worth the amount of time it takes), and introduce a dnfify() entry point so that unintelligible backwards logic in UNION processing can be eliminated. This is just an intermediate step --- next thing is to look at not forcing the qual into CNF form when it would be better off in DNF form.
* Performance improvements in cnfify(): get rid of exponentialTom Lane1999-09-071-249/+236
| | | | | | | | space consumption in pull_args, and avoid doing the full CNF transform on operands of operator clauses, where it's really not particularly helpful. This answers the TODO item about large numbers of OR clauses, at least partially. I was able to do a ten-thousand-OR-clause query with about 20Mb memory consumption ... it took an obscenely long time, but it worked...
* Final cleanup.Bruce Momjian1999-07-161-3/+3
|
* Remove unused #includes in *.c files.Bruce Momjian1999-07-151-3/+1
|
* pgindent run over code.Bruce Momjian1999-05-251-12/+17
|
* Fix a number of places that made faulty assumptions aboutTom Lane1999-02-151-24/+57
| | | | what is_opclause will accept.
* Change my-function-name-- to my_function_name, and optimizer renames.Bruce Momjian1999-02-131-2/+2
|
* Cleanup of source files where 'return' or 'var =' is alone on a line.Bruce Momjian1999-02-031-5/+3
|