aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer/util/pathnode.c
Commit message (Collapse)AuthorAge
* Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.Bruce Momjian2001-01-24
|
* Planner speedup hacking. Avoid saving useless pathkeys, so that pathTom Lane2000-12-14
| | | | | | | | | | | | comparison does not consider paths different when they differ only in uninteresting aspects of sort order. (We had a special case of this consideration for indexscans already, but generalize it to apply to ordered join paths too.) Be stricter about what is a canonical pathkey to allow faster pathkey comparison. Cache canonical pathkeys and dispersion stats for left and right sides of a RestrictInfo's clause, to avoid repeated computation. Total speedup will depend on number of tables in a query, but I see about 4x speedup of planning phase for a sample seven-table query.
* Restructure handling of inheritance queries so that they work with outerTom Lane2000-11-12
| | | | | | | | | | | | | | | | | joins, and clean things up a good deal at the same time. Append plan node no longer hacks on rangetable at runtime --- instead, all child tables are given their own RT entries during planning. Concept of multiple target tables pushed up into execMain, replacing bug-prone implementation within nodeAppend. Planner now supports generating Append plans for inheritance sets either at the top of the plan (the old way) or at the bottom. Expanding at the bottom is appropriate for tables used as sources, since they may appear inside an outer join; but we must still expand at the top when the target of an UPDATE or DELETE is an inheritance set, because we actually need a different targetlist and junkfilter for each target table in that case. Fortunately a target table can't be inside an outer join... Bizarre mutual recursion between union_planner and prepunion.c is gone --- in fact, union_planner doesn't really have much to do with union queries anymore, so I renamed it grouping_planner.
* Add proofreader's changes to docs.Bruce Momjian2000-10-05
| | | | Fix misspelling of disbursion to dispersion.
* 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
|
* Ye-old pgindent run. Same 4-space tabs.Bruce Momjian2000-04-12
|
* Repair logic flaw in cost estimator: cost_nestloop() was estimating CPUTom Lane2000-03-22
| | | | | | | | | | | | | costs using the inner path's parent->rows count as the number of tuples processed per inner scan iteration. This is wrong when we are using an inner indexscan with indexquals based on join clauses, because the rows count in a Relation node reflects the selectivity of the restriction clauses for that rel only. Upshot was that if join clause was very selective, we'd drastically overestimate the true cost of the join. Fix is to calculate correct output-rows estimate for an inner indexscan when the IndexPath node is created and save it in the path node. Change of path node doesn't require initdb, since path nodes don't appear in saved rules.
* Plug some more memory leaks in the planner. It still leaks like a sieve,Tom Lane2000-02-18
| | | | but this is as good as it'll get for this release...
* New cost model for planning, incorporating a penalty for random pageTom Lane2000-02-15
| | | | | | | | | | | | | | | | | | | | | | | | | accesses versus sequential accesses, a (very crude) estimate of the effects of caching on random page accesses, and cost to evaluate WHERE- clause expressions. Export critical parameters for this model as SET variables. Also, create SET variables for the planner's enable flags (enable_seqscan, enable_indexscan, etc) so that these can be controlled more conveniently than via PGOPTIONS. Planner now estimates both startup cost (cost before retrieving first tuple) and total cost of each path, so it can optimize queries with LIMIT on a reasonable basis by interpolating between these costs. Same facility is a win for EXISTS(...) subqueries and some other cases. Redesign pathkey representation to achieve a major speedup in planning (I saw as much as 5X on a 10-way join); also minor changes in planner to reduce memory consumption by recycling discarded Path nodes and not constructing unnecessary lists. Minor cleanups to display more-plausible costs in some cases in EXPLAIN output. Initdb forced by change in interface to index cost estimation functions.
* 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'.
* 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.
* Revise handling of index-type-specific indexscan cost estimation, perTom Lane2000-01-22
| | | | | | pghackers discussion of 5-Jan-2000. The amopselect and amopnpages estimators are gone, and in their place is a per-AM amcostestimate procedure (linked to from pg_am, not pg_amop).
* 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...
* Tid access method feature from Hiroshi Inoue, Inoue@tpf.co.jpBruce Momjian1999-11-23
|
* 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.
* Revise generation of hashjoin paths: generate one path perTom Lane1999-08-06
| | | | | | | | | | | | | | | hashjoinable clause, not one path for a randomly-chosen element of each set of clauses with the same join operator. That is, if you wrote SELECT ... WHERE t1.f1 = t2.f2 and t1.f3 = t2.f4, and both '=' ops were the same opcode (say, all four fields are int4), then the system would either consider hashing on f1=f2 or on f3=f4, but it would *not* consider both possibilities. Boo hiss. Also, revise estimation of hashjoin costs to include a penalty when the inner join var has a high disbursion --- ie, the most common value is pretty common. This tends to lead to badly skewed hash bucket occupancy and way more comparisons than you'd expect on average. I imagine that the cost calculation still needs tweaking, but at least it generates a more reasonable plan than before on George Young's example.
* Update comments about clause selectivity estimation.Tom Lane1999-07-30
|
* Further cleanups of indexqual processing: simplify controlTom Lane1999-07-30
| | | | | logic in indxpath.c, avoid generation of redundant indexscan paths for the same relation and index.
* Fix coredump seen when doing mergejoin between indexed tables,Tom Lane1999-07-30
| | | | | | for example in the regression test database, try select * from tenk1 t1, tenk1 t2 where t1.unique1 = t2.unique2; 6.5 has this same bug ...
* First cut at doing LIKE/regex indexing optimization inTom Lane1999-07-27
| | | | | | | | | | | | | | | | | | optimizer rather than parser. This has many advantages, such as not getting fooled by chance uses of operator names ~ and ~~ (the operators are identified by OID now), and not creating useless comparison operations in contexts where the comparisons will not actually be used as indexquals. The new code also recognizes exact-match LIKE and regex patterns, and produces an = indexqual instead of >= and <=. This change does NOT fix the problem with non-ASCII locales: the code still doesn't know how to generate an upper bound indexqual for non-ASCII collation order. But it's no worse than before, just the same deficiency in a different place... Also, dike out loc_restrictinfo fields in Plan nodes. These were doing nothing useful in the absence of 'expensive functions' optimization, and they took a considerable amount of processing to fill in.
* Further work on planning of indexscans. Cleaned up interfacesTom Lane1999-07-25
| | | | | to index_selectivity so that it can be handed an indexqual clause list rather than a bunch of assorted derivative data.
* Clean up messy clause-selectivity code in clausesel.c; repair bugTom Lane1999-07-24
| | | | | | | | | | | | | | | | | | | | identified by Hiroshi (incorrect cost attributed to OR clauses after multiple passes through set_rest_selec()). I think the code was trying to allow selectivities of OR subclauses to be passed in from outside, but noplace was actually passing any useful data, and set_rest_selec() was passing wrong data. Restructure representation of "indexqual" in IndexPath nodes so that it is the same as for indxqual in completed IndexScan nodes: namely, a toplevel list with an entry for each pass of the index scan, having sublists that are implicitly-ANDed index qual conditions for that pass. You don't want to know what the old representation was :-( Improve documentation of OR-clause indexscan functions. Remove useless 'notclause' field from RestrictInfo nodes. (This might force an initdb for anyone who has stored rules containing RestrictInfos, but I do not think that RestrictInfo ever appears in completed plans.)
* Final cleanup.Bruce Momjian1999-07-16
|
* Update #include cleanupsBruce Momjian1999-07-16
|
* Remove unused #includes in *.c files.Bruce Momjian1999-07-15
|
* Clean up #include in /include directory. Add scripts for checking includes.Bruce Momjian1999-07-15
|
* Another pgindent run. Sorry folks.Bruce Momjian1999-05-25
|
* pgindent run over code.Bruce Momjian1999-05-25
|
* From: Tatsuo Ishii <t-ishii@sra.co.jp>Marc G. Fournier1999-02-21
| | | | | | Ok. I made patches replacing all of "#if FALSE" or "#if 0" to "#ifdef NOT_USED" for current. I have tested these patches in that the postgres binaries are identical.
* pathkeys fixesBruce Momjian1999-02-20
|
* Update pathkeys comparison function.Bruce Momjian1999-02-20
|
* Fix bushy plans. Cleanup.Bruce Momjian1999-02-18
|
* Remove duplicate geqo functions, and more optimizer cleanupBruce Momjian1999-02-15
|
* Change my-function-name-- to my_function_name, and optimizer renames.Bruce Momjian1999-02-13
|
* JoinPath -> NestPath for nested loop.Bruce Momjian1999-02-12
|
* Fix optimizer and make faster.Bruce Momjian1999-02-12
|
* optimizer updateBruce Momjian1999-02-12
|
* Optimizer cleanups.Bruce Momjian1999-02-11
|
* Optimizer cleanup.Bruce Momjian1999-02-11
|
* optimizer cleanupBruce Momjian1999-02-11
|
* Optimizer cleanup.Bruce Momjian1999-02-11
|
* More optimization.Bruce Momjian1999-02-11
|
* More optimizer speedups.Bruce Momjian1999-02-11
|
* optimizer cleanupBruce Momjian1999-02-11
|
* Optimizer fix for samekeys() and cost fixes for longer optimizer keys.Bruce Momjian1999-02-11
|
* Optmizer cleanupBruce Momjian1999-02-10
|
* Rename Path.keys to Path.pathkeys. Too many 'keys' used for other things.Bruce Momjian1999-02-10
|
* Major optimizer improvement for joining a large number of tables.Bruce Momjian1999-02-09
|