postgresql/src/backend/commands
Tom Lane d4af2a6481 Clean up the loose ends in selectivity estimation left by my patch for semi
and anti joins.  To do this, pass the SpecialJoinInfo struct for the current
join as an additional optional argument to operator join selectivity
estimation functions.  This allows the estimator to tell not only what kind
of join is being formed, but which variable is on which side of the join;
a requirement long recognized but not dealt with till now.  This also leaves
the door open for future improvements in the estimators, such as accounting
for the null-insertion effects of lower outer joins.  I didn't do anything
about that in the current patch but the information is in principle deducible
from what's passed.

The patch also clarifies the definition of join selectivity for semi/anti
joins: it's the fraction of the left input that has (at least one) match
in the right input.  This allows getting rid of some very fuzzy thinking
that I had committed in the original 7.4-era IN-optimization patch.
There's probably room to estimate this better than the present patch does,
but at least we know what to estimate.

Since I had to touch CREATE OPERATOR anyway to allow a variant signature
for join estimator functions, I took the opportunity to add a couple of
additional checks that were missing, per my recent message to -hackers:
* Check that estimator functions return float8;
* Require execute permission at the time of CREATE OPERATOR on the
operator's function as well as the estimator functions;
* Require ownership of any pre-existing operator that's modified by
the command.
I also moved the lookup of the functions out of OperatorCreate() and
into operatorcmds.c, since that seemed more consistent with most of
the other catalog object creation processes, eg CREATE TYPE.
2008-08-16 00:01:38 +00:00
..
aggregatecmds.c ALTER AGGREGATE OWNER seems to have been missed by the last couple of 2008-06-08 21:09:48 +00:00
alter.c Rearrange ALTER TABLE syntax processing as per my recent proposal: the 2008-06-15 01:25:54 +00:00
analyze.c Rearrange the querytree representation of ORDER BY/GROUP BY/DISTINCT items 2008-08-02 21:32:01 +00:00
async.c Move the HTSU_Result enum definition into snapshot.h, to avoid including 2008-03-26 21:10:39 +00:00
cluster.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
comment.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
conversioncmds.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
copy.c Improve snapshot manager by keeping explicit track of snapshots. 2008-05-12 20:02:02 +00:00
dbcommands.c Improve CREATE/DROP/RENAME DATABASE so that when failing because the source 2008-08-04 18:03:46 +00:00
define.c Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
discard.c Update copyrights in source tree to 2008. 2008-01-01 19:46:01 +00:00
explain.c Implement SEMI and ANTI joins in the planner and executor. (Semijoins replace 2008-08-14 18:48:00 +00:00
functioncmds.c Implement SQL-spec RETURNS TABLE syntax for functions. 2008-07-18 03:32:53 +00:00
indexcmds.c Replace the hard-wired type knowledge in TypeCategory() and IsPreferredType() 2008-07-30 17:05:05 +00:00
lockcmds.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
Makefile Refactor backend makefiles to remove lots of duplicate code 2008-02-19 10:30:09 +00:00
opclasscmds.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
operatorcmds.c Clean up the loose ends in selectivity estimation left by my patch for semi 2008-08-16 00:01:38 +00:00
portalcmds.c Adjust things so that the query_string of a cached plan and the sourceText of 2008-07-18 20:26:06 +00:00
prepare.c Add comment about the two different query strings that ExecuteQuery() 2008-07-21 15:26:55 +00:00
proclang.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
schemacmds.c Refactor the handling of the various DropStmt variants so that when multiple 2008-06-14 18:04:34 +00:00
sequence.c Clean up the use of some page-header-access macros: principally, use 2008-07-13 20:45:47 +00:00
tablecmds.c Introduce the concept of relation forks. An smgr relation can now consist 2008-08-11 11:05:11 +00:00
tablespace.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
trigger.c Adjust things so that the query_string of a cached plan and the sourceText of 2008-07-18 20:26:06 +00:00
tsearchcmds.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00
typecmds.c Require superuser privilege to create base types (but not composites, enums, 2008-07-31 16:27:16 +00:00
user.c Restructure some header files a bit, in particular heapam.h, by removing some 2008-05-12 00:00:54 +00:00
vacuum.c Have autovacuum consider processing TOAST tables separately from their 2008-08-13 00:07:50 +00:00
vacuumlazy.c Restructure some header files a bit, in particular heapam.h, by removing some 2008-05-12 00:00:54 +00:00
variable.c Improve snapshot manager by keeping explicit track of snapshots. 2008-05-12 20:02:02 +00:00
view.c Improve our #include situation by moving pointer types away from the 2008-06-19 00:46:06 +00:00