aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor
Commit message (Collapse)AuthorAge
* Further planner/optimizer cleanups. Move all set_tlist_referencesTom Lane1999-08-22
| | | | | | | | | | and fix_opids processing to a single recursive pass over the plan tree executed at the very tail end of planning, rather than haphazardly here and there at different places. Now that tlist Vars do not get modified until the very end, it's possible to get rid of the klugy var_equal and match_varid partial-matching routines, and just use plain equal() throughout the optimizer. This is a step towards allowing merge and hash joins to be done on expressions instead of only Vars ...
* Major revision of sort-node handling: push knowledge of queryTom Lane1999-08-21
| | | | | | | | | | | | | 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.
* Add commentary to show that even though ExecInitIndexScan()Tom Lane1999-08-12
| | | | | | | contains much code that looks like it will handle indexquals with the index key on either side of the operator, in fact indexquals must have the index key on the left because of limitations of the ScanKey machinery. Perhaps someone will be motivated to fix that someday...
* > > Prevent sorting if result is already sortedBruce Momjian1999-08-09
| | | | | | | | | | | | | | > > > > 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
* Rewrite parser's handling of INSERT ... SELECT so that processingTom Lane1999-07-19
| | | | | | | | | of the SELECT part of the statement is just like a plain SELECT. All INSERT-specific processing happens after the SELECT parsing is done. This eliminates many problems, e.g. INSERT ... SELECT ... GROUP BY using the wrong column labels. Ensure that DEFAULT clauses are coerced to the target column type, whether or not stored clause produces the right type. Substantial cleanup of parser's array support.
* Move some system includes into c.h, and remove duplicates.Bruce Momjian1999-07-17
|
* Fix incorrect declaration of rtentry as 'ResTarget' where itTom Lane1999-07-17
| | | | should be 'RangeTblEntry' ; explain.c had copied the erroneous code.
* 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
|
* Remove S*I comments from Stephan.Bruce Momjian1999-07-13
|
* ExecReScanGroup() forgot to clear grpstate->grp_firstTuple,Tom Lane1999-07-11
| | | | thereby guaranteeing wrong results from a rescanned Group node.
* Remove QUERY_LIMIT and documenation on same. Change _ALIGN to TYPEALIGNBruce Momjian1999-06-17
| | | | for Irix.
* When targetlist is NULL, ExecTargetList was passing back aTom Lane1999-06-12
| | | | | | | | pointer to palloc'd but uninitialized memory. This is not cool; anyone looking at the returned 'tuple' would at best coredump and at worst behave in a bizarre and irreproducible way. Fix it to return a predictable value, namely a correctly-set-up palloc'd tuple containing zero attributes. I believe this fix is both safe and critical.
* Reversed out Massimo patch.Bruce Momjian1999-06-12
|
* I don't like last minute patches before the final freeze, but I believe thatBruce Momjian1999-06-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this one could be useful for people experiencing out-of-memory crashes while executing queries which retrieve or use a very large number of tuples. The problem happens when storage is allocated for functions results used in a large query, for example: select upper(name) from big_table; select big_table.array[1] from big_table; select count(upper(name)) from big_table; This patch is a dirty hack that fixes the out-of-memory problem for the most common cases, like the above ones. It is not the final solution for the problem but it can work for some people, so I'm posting it. The patch should be safe because all changes are under #ifdef. Furthermore the feature can be enabled or disabled at runtime by the `free_tuple_memory' options in the pg_options file. The option is disabled by default and must be explicitly enabled at runtime to have any effect. To enable the patch add the follwing line to Makefile.custom: CUSTOM_COPT += -DFREE_TUPLE_MEMORY To enable the option at runtime add the following line to pg_option: free_tuple_memory=1 Massimo
* Reset evaluation plan tuple table next free slot counter to 0Vadim B. Mikheev1999-06-09
| | | | | | | | | | | | | | | | | | | | | | | | | after ExecEndNode. It must be done! Or we'll be out of free tuple slots very soon, though slots are freed by ExecEndNode and ready for reusing. We didn't see this problem before because of int nSlots = ExecCountSlotsNode(plan); TupleTable tupleTable = ExecCreateTupleTable(nSlots + 10); /* why add ten? - jolly */ code in InitPlan - i.e. extra 10 slots. Simple select uses 3 slots and so it was possible to re-use evaluation plan 3 additional times and didn't get elog(NOTICE, "Plan requires more slots than are available"); elog(ERROR, "send mail to your local executor guru to fix this"); Changes are obvious and shouldn't be problems with them. Though, I added Assert(epqstate->es_tupleTable->next == 0) before EvalPlanQual():ExecInitNode and we'll notice if something is still wrong. Is it better to change Assert to elog(ERROR) ?
* I used bad style of comments and ... commented out some code inVadim B. Mikheev1999-06-06
| | | | | EvalPlanQualNext() when implemented it... -:) Uncommented...
* Ensure consistent results when FormSortKeys fails to findTom Lane1999-06-03
| | | | all the expected keys (it was returning uninitialized memory).
* Another pgindent run. Sorry folks.Bruce Momjian1999-05-25
|
* pgindent run over code.Bruce Momjian1999-05-25
|
* Rewrite hash join to use simple linked lists instead of aTom Lane1999-05-18
| | | | | | | fixed-size hashtable. This should prevent 'hashtable out of memory' errors, unless you really do run out of memory. Note: target size for hashtable is now taken from -S postmaster switch, not -B, since it is local memory in the backend rather than shared memory.
* Change resjunk to a boolean.Bruce Momjian1999-05-17
|
* Rip out QueryTreeList structure, root and branch. QuerytreeTom Lane1999-05-13
| | | | | | | | | | lists are now plain old garden-variety Lists, allocated with palloc, rather than specialized expansible-array data allocated with malloc. This substantially simplifies their handling and eliminates several sources of memory leakage. Several basic types of erroneous queries (syntax error, attempt to insert a duplicate key into a unique index) now demonstrably leak zero bytes per query.
* Change error messages to oids come out as %u and not %d. Change has noBruce Momjian1999-05-10
| | | | real affect now.
* Update hash and join routines to use fd.c's new temp-fileTom Lane1999-05-09
| | | | code, instead of not-very-bulletproof stuff they had before.
* Fix some nasty coredump bugs in hashjoin. This code was justTom Lane1999-05-06
| | | | | | | | | | about certain to fail anytime it decided the relation to be hashed was too big to fit in memory --- the code for 'batching' a series of hashjoins had multiple errors. I've fixed the easier problems. A remaining big problem is that you can get 'hashtable out of memory' if the code's guesstimate about how much overflow space it will need turns out wrong. That will require much more extensive revisions to fix, so I'm committing these fixes now before I start on that problem.
* Aggregate functions didn't work on subscripted array references.Tom Lane1999-04-29
| | | | Things are better now.
* Fix problems seen when result of a subselect was used in anTom Lane1999-04-19
| | | | | | | expression context (ie, not at the top level of a WHERE clause). Examples like this one work now: SELECT name, value FROM t1 as touter WHERE (value/(SELECT AVG(value) FROM t1 WHERE name = touter.name)) > 0.75;
* There are some bugs about backward scanning usingBruce Momjian1999-04-13
| | | | | | | | | | | | | | | indexes. 1. Index Scan using plural indexids never scan backward as to the order of indexids. 2. The cursor using Index scan is not usable after moving past the end. This patch solves above bugs. Moreover the change of _bt_first() would be useful to extend ORDER BY patch by Jan Wieck for all descending order cases. Hiroshi Inoue
* Fix some more hashjoin-related bugs in pg_operator. FixTom Lane1999-04-07
| | | | | | | hashjoin's hashFunc() so that it does the right thing with pass-by-value data types (the old code would always return 0 for int2 or char values, which would work but would slow things down a lot). Extend opr_sanity regress test to catch more kinds of errors.
* Small cleanups.Bruce Momjian1999-03-30
|
* Remove Tee code, move to _deadcode.Bruce Momjian1999-03-23
|
* Correct some comments, fix a small memory wastage when datatypeTom Lane1999-03-21
| | | | is pass-by-value.
* Reverse out pfree agg part of patch from Erik Riedel.Bruce Momjian1999-03-20
|
* cleanupBruce Momjian1999-03-20
|
* Fix for aggregate memory leaks from Erik Riedel.Bruce Momjian1999-03-20
|
* Fix for memory leak in executor with fjIsNull.Bruce Momjian1999-03-19
|
* I suggest the following portability patch, which does notBruce Momjian1999-03-19
| | | | | | | | | | change functionality, but makes the code more ANSI C'ish. My AIX xlc compiler barfs on all of these. Can someone please review and apply to current. <<port.patch>> Thanks Andreas
* CleanupBruce Momjian1999-03-14
|
* We have to return dummy tuple for empty targetlist!Vadim B. Mikheev1999-03-10
| | | | | | Try select t1.x from t1, t2 where t1.y = 1 and t2.y = 1 - t2 scan target list will be empty and so no one tuple will be returned...
* Changes to fix/improve the dynamic loading on NTMarc G. Fournier1999-03-09
| | | | From: Horak Daniel <horak@mmp.plzen-city.cz>
* Fix executor to work correctly with mergejoins where left andTom Lane1999-02-28
| | | | right sides have different data types.
* update commentsBruce Momjian1999-02-24
|
* Fix typos in comments.Thomas G. Lockhart1999-02-23
|
* Add first code to help with outer joins.Thomas G. Lockhart1999-02-23
| | | | | | Enable by defining CFLAGS+= -DENABLE_OUTER_JOINS -DEXEC_MERGEJOINDEBUG in your Makefile.custom
* Fix typo in comment.Thomas G. Lockhart1999-02-23
|
* comment cleanup.Bruce Momjian1999-02-22
|
* 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.