aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer/path/joinrels.c
Commit message (Collapse)AuthorAge
* IN clauses appearing at top level of WHERE can now be handled as joins.Tom Lane2003-01-20
| | | | | | | | | | There are two implementation techniques: the executor understands a new JOIN_IN jointype, which emits at most one matching row per left-hand row, or the result of the IN's sub-select can be fed through a DISTINCT filter and then joined as an ordinary relation. Along the way, some minor code cleanup in the optimizer; notably, break out most of the jointree-rearrangement preprocessing in planner.c and put it in a new file prep/prepjointree.c.
* Fix GEQO to work again in CVS tip, by being more careful about memoryTom Lane2002-12-16
| | | | | | | | | | | allocation in best_inner_indexscan(). While at it, simplify GEQO's interface to the main planner --- make_join_rel() offers exactly the API it really wants, whereas calling make_rels_by_clause_joins() and make_rels_by_clauseless_joins() required jumping through hoops. Rewrite gimme_tree for clarity (sometimes iteration is much better than recursion), and approximately halve GEQO's runtime by recognizing that tours of the forms (a,b,c,d,...) and (b,a,c,d,...) are equivalent because of symmetry in make_join_rel().
* Update copyright to 2002.Bruce Momjian2002-06-20
|
* Restructure representation of join alias variables. An explicit JOINTom Lane2002-03-12
| | | | | | | | | | | | | | | now has an RTE of its own, and references to its outputs now are Vars referencing the JOIN RTE, rather than CASE-expressions. This allows reverse-listing in ruleutils.c to use the correct alias easily, rather than painfully reverse-engineering the alias namespace as it used to do. Also, nested FULL JOINs work correctly, because the result of the inner joins are simple Vars that the planner can cope with. This fixes a bug reported a couple times now, notably by Tatsuo on 18-Nov-01. The alias Vars are expanded into COALESCE expressions where needed at the very end of planning, rather than during parsing. Also, beginnings of support for showing plan qualifier expressions in EXPLAIN. There are probably still cases that need work. initdb forced due to change of stored-rule representation.
* pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian2001-10-25
| | | | tests pass.
* Extend code that deduces implied equality clauses to detect whether aTom Lane2001-10-18
| | | | | | | | clause being added to a particular restriction-clause list is redundant with those already in the list. This avoids useless work at runtime, and (perhaps more importantly) keeps the selectivity estimation routines from generating too-small estimates of numbers of output rows. Also some minor improvements in OPTIMIZER_DEBUG displays.
* Modify optimizer data structures so that IndexOptInfo lists built forTom Lane2001-05-20
| | | | | | | | create_index_paths are not immediately discarded, but are available for subsequent planner work. This allows avoiding redundant syscache lookups in several places. Change interface to operator selectivity estimation procedures to allow faster and more flexible estimation. Initdb forced due to change of pg_proc entries for selectivity functions!
* pgindent run. Make it all clean.Bruce Momjian2001-03-22
|
* Take OUTER JOIN semantics into account when estimating the size of joinTom Lane2001-02-16
| | | | | relations. It's not very bright, but at least it now knows that A LEFT JOIN B must produce at least as many rows as are in A ...
* Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian2001-01-24
|
* Make sure make_rels_by_clause_joins doesn't return multiple referencesTom Lane2000-12-18
| | | | | to same joinrel. Although make_rels_by_joins doesn't mind, GEQO has an Assert that doesn't like this.
* Subselects in FROM clause, per ISO syntax: FROM (SELECT ...) [AS] alias.Tom Lane2000-09-29
| | | | | | | | | (Don't forget that an alias is required.) Views reimplemented as expanding to subselect-in-FROM. Grouping, aggregates, DISTINCT in views actually work now (he says optimistically). No UNION support in subselects/views yet, but I have some ideas about that. Rule-related permissions checking moved out of rewriter and into executor. INITDB REQUIRED!
* First cut at full support for OUTER JOINs. There are still a few looseTom Lane2000-09-12
| | | | | ends to clean up (see my message of same date to pghackers), but mostly it works. INITDB REQUIRED!
* Remove unused include files. Do not touch /port or includes used by defines.Bruce Momjian2000-05-30
|
* Repair problem noted by Elphick: make_rels_by_joins failed to handleTom Lane2000-04-27
| | | | | | | | cases where joinclauses were present but some joins have to be made by cartesian-product join anyway. An example is SELECT * FROM a,b,c WHERE (a.f1 + b.f2 + c.f3) = 0; Even though all the rels have joinclauses, we must join two of them in cartesian style before we can use the join clause...
* Ye-old pgindent run. Same 4-space tabs.Bruce Momjian2000-04-12
|
* Repair planning bugs caused by my misguided removal of restrictinfo linkTom Lane2000-02-07
| | | | | | | | | | | fields in JoinPaths --- turns out that we do need that after all :-(. Also, rearrange planner so that only one RelOptInfo is created for a particular set of joined base relations, no matter how many different subsets of relations it can be created from. This saves memory and processing time compared to the old method of making a bunch of RelOptInfos and then removing the duplicates. Clean up the jointree iteration logic; not sure if it's better, but I sure find it more readable and plausible now, particularly for the case of 'bushy plans'.
* Rename same() to sameseti() to have a slightly less generic name. MoveTom Lane2000-02-06
| | | | | | nonoverlap_sets() and is_subset() to list.c, where they should have lived to begin with, and rename to nonoverlap_setsi and is_subseti since they only work on integer lists.
* Add:Bruce Momjian2000-01-26
| | | | | | * Portions Copyright (c) 1996-2000, PostgreSQL, Inc to all files copyright Regents of Berkeley. Man, that's a lot of files.
* Another round of planner/optimizer work. This is just restructuring andTom Lane2000-01-09
| | | | | code cleanup; no major improvements yet. However, EXPLAIN does produce more intuitive outputs for nested loops with indexscans now...
* Major planner/optimizer revision: get rid of PathOrder node type,Tom Lane1999-08-16
| | | | | | | | | store all ordering information in pathkeys lists (which are now lists of lists of PathKeyItem nodes, not just lists of lists of vars). This was a big win --- the code is smaller and IMHO more understandable than it was, even though it handles more cases. I believe the node changes will not force an initdb for anyone; planner nodes don't show up in stored rules.
* Correct bug in best_innerjoin(): it should check all theTom Lane1999-07-27
| | | | | | | rels that the inner path needs to join to, but it was only checking for the first one. Failure could only have been observed with an OR-clause that mentions 3 or more tables, and then only if the bogus path was actually selected as cheapest ...
* Final cleanup.Bruce Momjian1999-07-16
|
* Remove unused #includes in *.c files.Bruce Momjian1999-07-15
|
* Make functions static or NOT_USED as appropriate.Bruce Momjian1999-05-26
|
* Another pgindent run. Sorry folks.Bruce Momjian1999-05-25
|
* pgindent run over code.Bruce Momjian1999-05-25
|
* more cleanupBruce Momjian1999-02-22
|
* Final optimizer cleanups.Bruce Momjian1999-02-22
|
* Enable bushy and right-hand queries by default.Bruce Momjian1999-02-18
|
* Enable bushy plans by default.Bruce Momjian1999-02-18
|
* more optimizer cleanupsBruce Momjian1999-02-18
|
* Fix bushy plans. Cleanup.Bruce Momjian1999-02-18
|
* Re-enable bushy plans. Vadim want them.Bruce Momjian1999-02-16
|
* otherrels is now unjoined_relsBruce Momjian1999-02-15
|
* optimizer renameBruce Momjian1999-02-15
|
* Remove duplicate geqo functions, and more optimizer cleanupBruce Momjian1999-02-15
|
* Replace non-idiomatic nconc(x, lcons(y, NIL)) with lappend(x, y).Tom Lane1999-02-15
|
* Optimizer rename.Bruce Momjian1999-02-14
|
* Change my-function-name-- to my_function_name, and optimizer renames.Bruce Momjian1999-02-13
|
* Fix optimizer and make faster.Bruce Momjian1999-02-12
|
* Optmizer cleanupBruce Momjian1999-02-10
|
* Cleanup of source files where 'return' or 'var =' is alone on a line.Bruce Momjian1999-02-03
|
* Optimizer rename ClauseInfo -> RestrictInfo. Update optimizer README.Bruce Momjian1999-02-03
|
* OK, folks, here is the pgindent output.Bruce Momjian1998-09-01
|
* Renaming cleanup, no pgindent yet.Bruce Momjian1998-09-01
|
* Cleanup optimizer function names and clarify code.Bruce Momjian1998-08-10
|
* MergeSort was sometimes called mergejoin and was confusing. NowBruce Momjian1998-08-04
| | | | it is now only mergejoin.
* Rename Rel to RelOptInfo.Bruce Momjian1998-07-18
|
* Remove un-needed braces around single statements.Bruce Momjian1998-06-15
|