summaryrefslogtreecommitdiff
path: root/src/backend/nodes/readfuncs.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove 'func_tlist' from Func expression nodes, likewise 'param_tlist'Tom Lane2000-08-081-32/+38
| | | | | | | | 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.
* Remove 'Array' node type, which has evidently been dead code forTom Lane2000-07-221-45/+1
| | | | a very long time.
* Revise aggregate functions per earlier discussions in pghackers.Tom Lane2000-07-171-5/+1
| | | | | | | | | | | There's now only one transition value and transition function. NULL handling in aggregates is a lot cleaner. Also, use Numeric accumulators instead of integer accumulators for sum/avg on integer datatypes --- this avoids overflow at the cost of being a little slower. Implement VARIANCE() and STDDEV() aggregates in the standard backend. Also, enable new LIKE selectivity estimators by default. Unrelated change, but as long as I had to force initdb anyway...
* First stage of reclaiming memory in executor by resetting short-termTom Lane2000-07-121-2/+2
| | | | | | memory contexts. Currently, only leaks in expressions executed as quals or projections are handled. Clean up some old dead cruft in executor while at it --- unused fields in state nodes, that sort of thing.
* Reimplement nodeMaterial to use a temporary BufFile (or even memory, if theTom Lane2000-06-181-37/+3
| | | | | | | | | | materialized tupleset is small enough) instead of a temporary relation. This was something I was thinking of doing anyway for performance, and Jan says he needs it for TOAST because he doesn't want to cope with toasting noname relations. With this change, the 'noname table' support in heap.c is dead code, and I have accordingly removed it. Also clean up 'noname' plan handling in planner --- nonames are either sort or materialize plans, and it seems less confusing to handle them separately under those names.
* Repair unforgivably brain-dead representation of CaseExpr nodes inTom Lane2000-06-161-18/+27
| | | | stored rules. Bump catversion to reflect incompatibility.
* Remove unused include files. Do not touch /port or includes used by defines.Bruce Momjian2000-05-301-2/+1
|
* Ye-old pgindent run. Same 4-space tabs.Bruce Momjian2000-04-121-16/+16
|
* Repair logic flaw in cost estimator: cost_nestloop() was estimating CPUTom Lane2000-03-221-1/+5
| | | | | | | | | | | | | 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.
* Fix a bunch of minor portability problems and maybe-bugs revealed byTom Lane2000-03-171-3/+3
| | | | | | running gcc and HP's cc with warnings cranked way up. Signed vs unsigned comparisons, routines declared static and then defined not-static, that kind of thing. Tedious, but perhaps useful...
* Create a new expression node type RelabelType, which exists solely toTom Lane2000-02-201-1/+32
| | | | | | | | | | represent the result of a binary-compatible type coercion. At runtime it just evaluates its argument --- but during type resolution, exprType will pick up the output type of the RelabelType node instead of the type of the argument. This solves some longstanding problems with dropped type coercions, an example being 'select now()::abstime::int4' which used to produce date-formatted output, not an integer, because the coercion to int4 was dropped on the floor.
* New cost model for planning, incorporating a penalty for random pageTom Lane2000-02-151-65/+55
| | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Carry column aliases from the parser frontend. Enables queries likeThomas G. Lockhart2000-02-151-7/+58
| | | | | | | SELECT a FROM t1 tx (a); Allow join syntax, including queries like SELECT * FROM t1 NATURAL JOIN t2; Update RTE structure to hold column aliases in an Attr structure.
* Repair planning bugs caused by my misguided removal of restrictinfo linkTom Lane2000-02-071-48/+15
| | | | | | | | | | | 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'.
* Redesign DISTINCT ON as discussed in pgsql-sql 1/25/00: syntax is nowTom Lane2000-01-271-36/+3
| | | | | | | | | | | | | SELECT DISTINCT ON (expr [, expr ...]) targetlist ... and there is a check to make sure that the user didn't specify an ORDER BY that's incompatible with the DISTINCT operation. Reimplement nodeUnique and nodeGroup to use the proper datatype-specific equality function for each column being compared --- they used to do bitwise comparisons or convert the data to text strings and strcmp(). (To add insult to injury, they'd look up the conversion functions once for each tuple...) Parse/plan representation of DISTINCT is now a list of SortClause nodes. initdb forced by querytree change...
* 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.
* Revise handling of index-type-specific indexscan cost estimation, perTom Lane2000-01-221-31/+1
| | | | | | 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).
* Revise quoting conventions in outfuncs/readfuncs so that nodeRead doesn'tTom Lane2000-01-141-87/+63
| | | | | | choke on relation or attribute names containing spaces, quotes, or other special characters. This fixes a TODO item. It also forces initdb, since stored rule strings change.
* Another round of planner/optimizer work. This is just restructuring andTom Lane2000-01-091-27/+44
| | | | | code cleanup; no major improvements yet. However, EXPLAIN does produce more intuitive outputs for nested loops with indexscans now...
* aggregate(DISTINCT ...) works, per SQL spec.Tom Lane1999-12-131-1/+9
| | | | Note this forces initdb because of change of Aggref node in stored rules.
* Tid access method feature from Hiroshi Inoue, Inoue@tpf.co.jpBruce Momjian1999-11-231-1/+67
|
* Fix planner and rewriter to follow SQL semantics for tables that areTom Lane1999-10-071-1/+5
| | | | | | | | | | | mentioned in FROM but not elsewhere in the query: such tables should be joined over anyway. Aside from being more standards-compliant, this allows removal of some very ugly hacks for COUNT(*) processing. Also, allow HAVING clause without aggregate functions, since SQL does. Clean up CREATE RULE statement-list syntax the same way Bruce just fixed the main stmtmulti production. CAUTION: addition of a field to RangeTblEntry nodes breaks stored rules; you will have to initdb if you have any rules.
* Major revision of sort-node handling: push knowledge of queryTom Lane1999-08-211-24/+16
| | | | | | | | | | | | | sort order down into planner, instead of handling it only at the very top level of the planner. This fixes many things. An explicit sort is now avoided if there is a cheaper alternative (typically an indexscan) not only for ORDER BY, but also for the internal sort of GROUP BY. It works even when there is no other reason (such as a WHERE condition) to consider the indexscan. It works for indexes on functions. It works for indexes on functions, backwards. It's just so cool... CAUTION: I have changed the representation of SortClause nodes, therefore THIS UPDATE BREAKS STORED RULES. You will need to initdb.
* Major planner/optimizer revision: get rid of PathOrder node type,Tom Lane1999-08-161-259/+29
| | | | | | | | | 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.
* > > Prevent sorting if result is already sortedBruce Momjian1999-08-091-1/+6
| | | | | | | | | | | | | | > > > > was implemented by Jan Wieck. > > His work is for ascending order cases. > > > > Here is a patch to prevent sorting also in descending > > order cases. > > Because I had already changed _bt_first() to position > > backward correctly before v6.5,this patch would work. > > Hiroshi Inoue Inoue@tpf.co.jp
* Clean up messy clause-selectivity code in clausesel.c; repair bugTom Lane1999-07-241-9/+1
| | | | | | | | | | | | | | | | | | | | 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.)
* Move some system includes into c.h, and remove duplicates.Bruce Momjian1999-07-171-3/+1
|
* Final cleanup.Bruce Momjian1999-07-161-4/+4
|
* Remove unused #includes in *.c files.Bruce Momjian1999-07-151-10/+1
|
* Clean up #include in /include directory. Add scripts for checking includes.Bruce Momjian1999-07-151-3/+1
|
* Remove S*I comments from Stephan.Bruce Momjian1999-07-131-2/+1
|
* pgindent run over code.Bruce Momjian1999-05-251-30/+31
|
* Remove no-longer-used fields in Hash and HashJoin nodes.Tom Lane1999-05-181-25/+1
|
* Change resjunk to a boolean.Bruce Momjian1999-05-171-2/+2
|
* Replaced targetlist entry in GroupClause by reference numberJan Wieck1999-05-121-4/+9
| | | | | | | in Resdom and GroupClause so changing of resno's doesn't confuse the grouping any more. Jan
* Executor no longer cares about mergejoinop, mergerightorder, mergeleftorder,Tom Lane1999-03-011-5/+1
| | | | | | | | | so remove them from MergeJoin node. Hack together a partial solution for commuted mergejoin operators --- yesterday a mergejoin int4 = int8 would crash if the planner decided to commute it, today it works. The planner's representation of mergejoins really needs a rewrite though. Also, further testing of mergejoin ops in opr_sanity regress test.
* Fix bushy plans. Cleanup.Bruce Momjian1999-02-181-3/+3
|
* otherrels is now unjoined_relsBruce Momjian1999-02-151-3/+3
|
* Change my-function-name-- to my_function_name, and optimizer renames.Bruce Momjian1999-02-131-2/+2
|
* JoinPath -> NestPath for nested loop.Bruce Momjian1999-02-121-11/+11
|
* Fix optimizer and make faster.Bruce Momjian1999-02-121-7/+1
|
* More optimizer speedups.Bruce Momjian1999-02-111-11/+11
|
* Rename Path.keys to Path.pathkeys. Too many 'keys' used for other things.Bruce Momjian1999-02-101-11/+11
|
* Rename Temp to Noname for noname tables.Bruce Momjian1999-02-091-21/+21
|
* Major optimizer improvement for joining a large number of tables.Bruce Momjian1999-02-091-13/+54
|
* Optimizer cleanup.Bruce Momjian1999-02-081-11/+11
|
* Optimizer cleanup.Bruce Momjian1999-02-051-3/+3
|
* More optimizer cleanups.Bruce Momjian1999-02-041-2/+2
|
* More optimizer renaming HInfo -> HashInfo.Bruce Momjian1999-02-041-8/+8
|
* Cleanup of source files where 'return' or 'var =' is alone on a line.Bruce Momjian1999-02-031-17/+9
|