CVS log for pgsql/src/backend/optimizer/util/relnode.c

[BACK] Up to [PostgreSQL CVS Repository] / pgsql / src / backend / optimizer / util

Request diff between arbitrary revisions - Display revisions graphically


Keyword substitution: kv
Default branch: MAIN


Revision 1.98: download - view: text, markup, annotated - select for diffs
Fri Feb 26 02:00:47 2010 UTC (15 years, 6 months ago) by momjian
Branches: MAIN
CVS tags: REL9_1_ALPHA1, REL9_0_STABLE, REL9_0_RC1, REL9_0_BETA4, REL9_0_BETA3, REL9_0_BETA2, REL9_0_BETA1, REL9_0_ALPHA5_BRANCH, REL9_0_ALPHA5, REL9_0_0, HEAD
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +4 -4 lines
pgindent run for 9.0

Revision 1.97: download - view: text, markup, annotated - select for diffs
Sat Jan 2 16:57:48 2010 UTC (15 years, 8 months ago) by momjian
Branches: MAIN
CVS tags: REL9_0_ALPHA4_BRANCH, REL9_0_ALPHA4
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +2 -2 lines
Update copyright for the year 2010.

Revision 1.96: download - view: text, markup, annotated - select for diffs
Sat Nov 28 00:46:19 2009 UTC (15 years, 9 months ago) by tgl
Branches: MAIN
CVS tags: REL8_5_ALPHA3_BRANCH, REL8_5_ALPHA3
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +15 -1 lines
Eliminate a lot of list-management overhead within join_search_one_level
by adding a requirement that build_join_rel add new join RelOptInfos to the
appropriate list immediately at creation.  Per report from Robert Haas,
the list_concat_unique_ptr() calls that this change eliminates were taking
the lion's share of the runtime in larger join problems.  This doesn't do
anything to fix the fundamental combinatorial explosion in large join
problems, but it should push out the threshold of pain a bit further.

Note: because this changes the order in which joinrel lists are built,
it might result in changes in selected plans in cases where different
alternatives have exactly the same costs.  There is one example in the
regression tests.

Revision 1.95: download - view: text, markup, annotated - select for diffs
Mon Oct 12 18:10:48 2009 UTC (15 years, 11 months ago) by tgl
Branches: MAIN
CVS tags: REL8_5_ALPHA2_BRANCH, REL8_5_ALPHA2
Diff to: previous 1.94: preferred, colored
Changes since revision 1.94: +3 -1 lines
Move the handling of SELECT FOR UPDATE locking and rechecking out of
execMain.c and into a new plan node type LockRows.  Like the recent change
to put table updating into a ModifyTable plan node, this increases planning
flexibility by allowing the operations to occur below the top level of the
plan tree.  It's necessary in any case to restore the previous behavior of
having FOR UPDATE locking occur before ModifyTable does.

This partially refactors EvalPlanQual to allow multiple rows-under-test
to be inserted into the EPQ machinery before starting an EPQ test query.
That isn't sufficient to fix EPQ's general bogosity in the face of plans
that return multiple rows per test row, though.  Since this patch is
mostly about getting some plan node infrastructure in place and not about
fixing ten-year-old bugs, I will leave EPQ improvements for another day.

Another behavioral change that we could now think about is doing FOR UPDATE
before LIMIT, but that too seems like it should be treated as a followon
patch.

Revision 1.94: download - view: text, markup, annotated - select for diffs
Thu Jun 11 14:48:59 2009 UTC (16 years, 3 months ago) by momjian
Branches: MAIN
CVS tags: REL8_5_ALPHA1_BRANCH, REL8_5_ALPHA1, REL8_4_STABLE, REL8_4_RC2, REL8_4_RC1, REL8_4_4, REL8_4_3, REL8_4_2, REL8_4_1, REL8_4_0
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +3 -3 lines
8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list
provided by Andrew.

Revision 1.93: download - view: text, markup, annotated - select for diffs
Thu Jan 1 17:23:45 2009 UTC (16 years, 8 months ago) by momjian
Branches: MAIN
CVS tags: REL8_4_BETA2, REL8_4_BETA1
Diff to: previous 1.92: preferred, colored
Changes since revision 1.92: +2 -2 lines
Update copyright for 2009.

Revision 1.92: download - view: text, markup, annotated - select for diffs
Tue Oct 21 20:42:53 2008 UTC (16 years, 10 months ago) by tgl
Branches: MAIN
Diff to: previous 1.91: preferred, colored
Changes since revision 1.91: +14 -4 lines
Add a concept of "placeholder" variables to the planner.  These are variables
that represent some expression that we desire to compute below the top level
of the plan, and then let that value "bubble up" as though it were a plain
Var (ie, a column value).

The immediate application is to allow sub-selects to be flattened even when
they are below an outer join and have non-nullable output expressions.
Formerly we couldn't flatten because such an expression wouldn't properly
go to NULL when evaluated above the outer join.  Now, we wrap it in a
PlaceHolderVar and arrange for the actual evaluation to occur below the outer
join.  When the resulting Var bubbles up through the join, it will be set to
NULL if necessary, yielding the correct results.  This fixes a planner
limitation that's existed since 7.1.

In future we might want to use this mechanism to re-introduce some form of
Hellerstein's "expensive functions" optimization, ie place the evaluation of
an expensive function at the most suitable point in the plan tree.

Revision 1.91: download - view: text, markup, annotated - select for diffs
Sat Oct 4 21:56:53 2008 UTC (16 years, 11 months ago) by tgl
Branches: MAIN
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +2 -1 lines
Implement SQL-standard WITH clauses, including WITH RECURSIVE.

There are some unimplemented aspects: recursive queries must use UNION ALL
(should allow UNION too), and we don't have SEARCH or CYCLE clauses.
These might or might not get done for 8.4, but even without them it's a
pretty useful feature.

There are also a couple of small loose ends and definitional quibbles,
which I'll send a memo about to pgsql-hackers shortly.  But let's land
the patch now so we can get on with other development.

Yoshiyuki Asaba, with lots of help from Tatsuo Ishii and Tom Lane

Revision 1.90: download - view: text, markup, annotated - select for diffs
Thu Aug 14 18:47:59 2008 UTC (17 years, 1 month ago) by tgl
Branches: MAIN
Diff to: previous 1.89: preferred, colored
Changes since revision 1.89: +4 -4 lines
Implement SEMI and ANTI joins in the planner and executor.  (Semijoins replace
the old JOIN_IN code, but antijoins are new functionality.)  Teach the planner
to convert appropriate EXISTS and NOT EXISTS subqueries into semi and anti
joins respectively.  Also, LEFT JOINs with suitable upper-level IS NULL
filters are recognized as being anti joins.  Unify the InClauseInfo and
OuterJoinInfo infrastructure into "SpecialJoinInfo".  With that change,
it becomes possible to associate a SpecialJoinInfo with every join attempt,
which permits some cleanup of join selectivity estimation.  That needs to be
taken much further than this patch does, but the next step is to change the
API for oprjoin selectivity functions, which seems like material for a
separate patch.  So for the moment the output size estimates for semi and
especially anti joins are quite bogus.

Revision 1.89: download - view: text, markup, annotated - select for diffs
Tue Jan 1 19:45:50 2008 UTC (17 years, 8 months ago) by momjian
Branches: MAIN
CVS tags: REL8_3_STABLE, REL8_3_RC2, REL8_3_RC1, REL8_3_9, REL8_3_8, REL8_3_7, REL8_3_6, REL8_3_5, REL8_3_4, REL8_3_3, REL8_3_2, REL8_3_11, REL8_3_10, REL8_3_1, REL8_3_0
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +2 -2 lines
Update copyrights in source tree to 2008.

Revision 1.88: download - view: text, markup, annotated - select for diffs
Thu Nov 15 21:14:36 2007 UTC (17 years, 9 months ago) by momjian
Branches: MAIN
CVS tags: REL8_3_BETA4, REL8_3_BETA3
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +10 -9 lines
pgindent run for 8.3.

Revision 1.52.4.2: download - view: text, markup, annotated - select for diffs
Tue Jul 31 19:54:27 2007 UTC (18 years, 1 month ago) by tgl
Branches: REL7_4_STABLE
CVS tags: REL7_4_29, REL7_4_28, REL7_4_27, REL7_4_26, REL7_4_25, REL7_4_24, REL7_4_23, REL7_4_22, REL7_4_21, REL7_4_20, REL7_4_19, REL7_4_18
Diff to: previous 1.52.4.1: preferred, colored; branchpoint 1.52: preferred, colored; next MAIN 1.53: preferred, colored
Changes since revision 1.52.4.1: +5 -2 lines
Fix a bug in the original implementation of redundant-join-clause removal:
clauses in which one side or the other references both sides of the join
cannot be removed as redundant, because that expression won't have been
constrained below the join.  Per report from Sergey Burladyan.

Revision 1.64.4.1: download - view: text, markup, annotated - select for diffs
Tue Jul 31 19:54:10 2007 UTC (18 years, 1 month ago) by tgl
Branches: REL8_0_STABLE
CVS tags: REL8_0_25, REL8_0_24, REL8_0_23, REL8_0_22, REL8_0_21, REL8_0_20, REL8_0_19, REL8_0_18, REL8_0_17, REL8_0_16, REL8_0_15, REL8_0_14
Diff to: previous 1.64: preferred, colored; next MAIN 1.65: preferred, colored
Changes since revision 1.64: +5 -2 lines
Fix a bug in the original implementation of redundant-join-clause removal:
clauses in which one side or the other references both sides of the join
cannot be removed as redundant, because that expression won't have been
constrained below the join.  Per report from Sergey Burladyan.

Revision 1.72.2.2: download - view: text, markup, annotated - select for diffs
Tue Jul 31 19:54:00 2007 UTC (18 years, 1 month ago) by tgl
Branches: REL8_1_STABLE
CVS tags: REL8_1_21, REL8_1_20, REL8_1_19, REL8_1_18, REL8_1_17, REL8_1_16, REL8_1_15, REL8_1_14, REL8_1_13, REL8_1_12, REL8_1_11, REL8_1_10
Diff to: previous 1.72.2.1: preferred, colored; branchpoint 1.72: preferred, colored; next MAIN 1.73: preferred, colored
Changes since revision 1.72.2.1: +3 -1 lines
Fix a bug in the original implementation of redundant-join-clause removal:
clauses in which one side or the other references both sides of the join
cannot be removed as redundant, because that expression won't have been
constrained below the join.  Per report from Sergey Burladyan.

Revision 1.83.2.1: download - view: text, markup, annotated - select for diffs
Tue Jul 31 19:53:50 2007 UTC (18 years, 1 month ago) by tgl
Branches: REL8_2_STABLE
CVS tags: REL8_2_9, REL8_2_8, REL8_2_7, REL8_2_6, REL8_2_5, REL8_2_17, REL8_2_16, REL8_2_15, REL8_2_14, REL8_2_13, REL8_2_12, REL8_2_11, REL8_2_10
Diff to: previous 1.83: preferred, colored; next MAIN 1.84: preferred, colored
Changes since revision 1.83: +3 -1 lines
Fix a bug in the original implementation of redundant-join-clause removal:
clauses in which one side or the other references both sides of the join
cannot be removed as redundant, because that expression won't have been
constrained below the join.  Per report from Sergey Burladyan.

Revision 1.87: download - view: text, markup, annotated - select for diffs
Sat Apr 21 21:01:45 2007 UTC (18 years, 4 months ago) by tgl
Branches: MAIN
CVS tags: REL8_3_BETA2, REL8_3_BETA1
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +6 -6 lines
Some further performance tweaks for planning large inheritance trees that
are mostly excluded by constraints: do the CE test a bit earlier to save
some adjust_appendrel_attrs() work on excluded children, and arrange to
use array indexing rather than rt_fetch() to fetch RTEs in the main body
of the planner.  The latter is something I'd wanted to do for awhile anyway,
but seeing list_nth_cell() as 35% of the runtime gets one's attention.

Revision 1.86: download - view: text, markup, annotated - select for diffs
Thu Feb 22 22:00:25 2007 UTC (18 years, 6 months ago) by tgl
Branches: MAIN
Diff to: previous 1.85: preferred, colored
Changes since revision 1.85: +3 -1 lines
Turn the rangetable used by the executor into a flat list, and avoid storing
useless substructure for its RangeTblEntry nodes.  (I chose to keep using the
same struct node type and just zero out the link fields for unneeded info,
rather than making a separate ExecRangeTblEntry type --- it seemed too
fragile to have two different rangetable representations.)

Along the way, put subplans into a list in the toplevel PlannedStmt node,
and have SubPlan nodes refer to them by list index instead of direct pointers.
Vadim wanted to do that years ago, but I never understood what he was on about
until now.  It makes things a *whole* lot more robust, because we can stop
worrying about duplicate processing of subplans during expression tree
traversals.  That's been a constant source of bugs, and it's finally gone.

There are some consequent simplifications yet to be made, like not using
a separate EState for subplans in the executor, but I'll tackle that later.

Revision 1.85: download - view: text, markup, annotated - select for diffs
Sat Jan 20 20:45:40 2007 UTC (18 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.84: preferred, colored
Changes since revision 1.84: +72 -61 lines
Refactor planner's pathkeys data structure to create a separate, explicit
representation of equivalence classes of variables.  This is an extensive
rewrite, but it brings a number of benefits:
* planner no longer fails in the presence of "incomplete" operator families
that don't offer operators for every possible combination of datatypes.
* avoid generating and then discarding redundant equality clauses.
* remove bogus assumption that derived equalities always use operators
named "=".
* mergejoins can work with a variety of sort orders (e.g., descending) now,
instead of tying each mergejoinable operator to exactly one sort order.
* better recognition of redundant sort columns.
* can make use of equalities appearing underneath an outer join.

Revision 1.84: download - view: text, markup, annotated - select for diffs
Fri Jan 5 22:19:33 2007 UTC (18 years, 8 months ago) by momjian
Branches: MAIN
Diff to: previous 1.83: preferred, colored
Changes since revision 1.83: +2 -2 lines
Update CVS HEAD for 2007 copyright.  Back branches are typically not
back-stamped for this.

Revision 1.83: download - view: text, markup, annotated - select for diffs
Wed Oct 4 00:29:55 2006 UTC (18 years, 11 months ago) by momjian
Branches: MAIN
CVS tags: REL8_2_RC1, REL8_2_BETA3, REL8_2_BETA2, REL8_2_4, REL8_2_3, REL8_2_2, REL8_2_1, REL8_2_0
Branch point for: REL8_2_STABLE
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +6 -5 lines
pgindent run for 8.2.

Revision 1.82: download - view: text, markup, annotated - select for diffs
Tue Sep 19 22:49:53 2006 UTC (18 years, 11 months ago) by tgl
Branches: MAIN
CVS tags: REL8_2_BETA1
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +25 -2 lines
Improve usage of effective_cache_size parameter by assuming that all the
tables in the query compete for cache space, not just the one we are
currently costing an indexscan for.  This seems more realistic, and it
definitely will help in examples recently exhibited by Stefan
Kaltenbrunner.  To get the total size of all the tables involved, we must
tweak the handling of 'append relations' a bit --- formerly we looked up
information about the child tables on-the-fly during set_append_rel_pathlist,
but it needs to be done before we start doing any cost estimation, so
push it into the add_base_rels_to_query scan.

Revision 1.81: download - view: text, markup, annotated - select for diffs
Wed Aug 2 01:59:46 2006 UTC (19 years, 1 month ago) by joe
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +8 -3 lines
Add support for multi-row VALUES clauses as part of INSERT statements
(e.g. "INSERT ... VALUES (...), (...), ...") and elsewhere as allowed
by the spec. (e.g. similar to a FROM clause subselect). initdb required.
Joe Conway and Tom Lane.

Revision 1.80: download - view: text, markup, annotated - select for diffs
Mon Jul 31 20:09:04 2006 UTC (19 years, 1 month ago) by tgl
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +2 -2 lines
Change the relation_open protocol so that we obtain lock on a relation
(table or index) before trying to open its relcache entry.  This fixes
race conditions in which someone else commits a change to the relation's
catalog entries while we are in process of doing relcache load.  Problems
of that ilk have been reported sporadically for years, but it was not
really practical to fix until recently --- for instance, the recent
addition of WAL-log support for in-place updates helped.

Along the way, remove pg_am.amconcurrent: all AMs are now expected to support
concurrent update.

Revision 1.79: download - view: text, markup, annotated - select for diffs
Fri Jul 14 14:52:21 2006 UTC (19 years, 2 months ago) by momjian
Branches: MAIN
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +1 -3 lines
Remove 576 references of include files that were not needed.

Revision 1.78: download - view: text, markup, annotated - select for diffs
Sun Mar 5 15:58:31 2006 UTC (19 years, 6 months ago) by momjian
Branches: MAIN
Diff to: previous 1.77: preferred, colored
Changes since revision 1.77: +2 -2 lines
Update copyright for 2006.  Update scripts.

Revision 1.77: download - view: text, markup, annotated - select for diffs
Sun Feb 5 02:59:17 2006 UTC (19 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.76: preferred, colored
Changes since revision 1.76: +1 -143 lines
Improve my initial, rather hacky implementation of joins to append
relations: fix the executor so that we can have an Append plan on the
inside of a nestloop and still pass down outer index keys to index scans
within the Append, then generate such plans as if they were regular
inner indexscans.  This avoids the need to evaluate the outer relation
multiple times.

Revision 1.76: download - view: text, markup, annotated - select for diffs
Fri Feb 3 21:08:49 2006 UTC (19 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +143 -1 lines
Teach planner to convert simple UNION ALL subqueries into append relations,
thereby sharing code with the inheritance case.  This puts the UNION-ALL-view
approach to partitioned tables on par with inheritance, so far as constraint
exclusion is concerned: it works either way.  (Still need to update the docs
to say so.)  The definition of "simple UNION ALL" is a little simpler than
I would like --- basically the union arms can only be SELECT * FROM foo
--- but it's good enough for partitioned-table cases.

Revision 1.75: download - view: text, markup, annotated - select for diffs
Tue Jan 31 21:39:24 2006 UTC (19 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.74: preferred, colored
Changes since revision 1.74: +33 -83 lines
Restructure planner's handling of inheritance.  Rather than processing
inheritance trees on-the-fly, which pretty well constrained us to considering
only one way of planning inheritance, expand inheritance sets during the
planner prep phase, and build a side data structure that can be consulted
later to find which RTEs are members of which inheritance sets.  As proof of
concept, use the data structure to plan joins against inheritance sets more
efficiently: we can now use indexes on the set members in inner-indexscan
joins.  (The generated plans could be improved further, but it'll take some
executor changes.)  This data structure will also support handling UNION ALL
subqueries in the same way as inheritance sets, but that aspect of it isn't
finished yet.

Revision 1.74: download - view: text, markup, annotated - select for diffs
Tue Dec 20 02:30:36 2005 UTC (19 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.73: preferred, colored
Changes since revision 1.73: +1 -3 lines
Teach planner how to rearrange join order for some classes of OUTER JOIN.
Per my recent proposal.  I ended up basing the implementation on the
existing mechanism for enforcing valid join orders of IN joins --- the
rules for valid outer-join orders are somewhat similar.

Revision 1.72.2.1: download - view: text, markup, annotated - select for diffs
Tue Nov 22 18:23:12 2005 UTC (19 years, 9 months ago) by momjian
Branches: REL8_1_STABLE
CVS tags: REL8_1_9, REL8_1_8, REL8_1_7, REL8_1_6, REL8_1_5, REL8_1_4, REL8_1_3, REL8_1_2, REL8_1_1
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +6 -6 lines
Re-run pgindent, fixing a problem where comment lines after a blank
comment line where output as too long, and update typedefs for /lib
directory.  Also fix case where identifiers were used as variable names
in the backend, but as typedefs in ecpg (favor the backend for
indenting).

Backpatch to 8.1.X.

Revision 1.73: download - view: text, markup, annotated - select for diffs
Tue Nov 22 18:17:15 2005 UTC (19 years, 9 months ago) by momjian
Branches: MAIN
Diff to: previous 1.72: preferred, colored
Changes since revision 1.72: +6 -6 lines
Re-run pgindent, fixing a problem where comment lines after a blank
comment line where output as too long, and update typedefs for /lib
directory.  Also fix case where identifiers were used as variable names
in the backend, but as typedefs in ecpg (favor the backend for
indenting).

Backpatch to 8.1.X.

Revision 1.72: download - view: text, markup, annotated - select for diffs
Sat Oct 15 02:49:21 2005 UTC (19 years, 11 months ago) by momjian
Branches: MAIN
CVS tags: REL8_1_0RC1, REL8_1_0BETA4, REL8_1_0
Branch point for: REL8_1_STABLE
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +41 -43 lines
Standard pgindent run for 8.1.

Revision 1.71: download - view: text, markup, annotated - select for diffs
Thu Jul 28 22:27:00 2005 UTC (20 years, 1 month ago) by tgl
Branches: MAIN
CVS tags: REL8_1_0BETA3, REL8_1_0BETA2, REL8_1_0BETA1
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +3 -3 lines
Make use of new list primitives list_append_unique and list_concat_unique
where applicable.

Revision 1.70: download - view: text, markup, annotated - select for diffs
Thu Jun 9 04:19:00 2005 UTC (20 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +32 -43 lines
Simplify the planner's join clause management by storing join clauses
of a relation in a flat 'joininfo' list.  The former arrangement grouped
the join clauses according to the set of unjoined relids used in each;
however, profiling on test cases involving lots of joins proves that
that data structure is a net loss.  It takes more time to group the
join clauses together than is saved by avoiding duplicate tests later.
It doesn't help any that there are usually not more than one or two
clauses per group ...

Revision 1.69: download - view: text, markup, annotated - select for diffs
Wed Jun 8 23:02:05 2005 UTC (20 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.68: preferred, colored
Changes since revision 1.68: +101 -8 lines
Marginal hack to avoid spending a lot of time in find_join_rel during
large planning problems: when the list of join rels gets too long, make
an auxiliary hash table that hashes on the identifying Bitmapset.

Revision 1.68: download - view: text, markup, annotated - select for diffs
Mon Jun 6 04:13:36 2005 UTC (20 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +71 -83 lines
Nab some low-hanging fruit: replace the planner's base_rel_list and
other_rel_list with a single array indexed by rangetable index.
This reduces find_base_rel from O(N) to O(1) without any real penalty.
While find_base_rel isn't one of the major bottlenecks in any profile
I've seen so far, it was starting to creep up on the radar screen
for complex queries --- so might as well fix it.

Revision 1.67: download - view: text, markup, annotated - select for diffs
Sun Jun 5 22:32:56 2005 UTC (20 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +13 -13 lines
Remove planner's private fields from Query struct, and put them into
a new PlannerInfo struct, which is passed around instead of the bare
Query in all the planning code.  This commit is essentially just a
code-beautification exercise, but it does open the door to making
larger changes to the planner data structures without having to muck
with the widely-known Query struct.

Revision 1.66: download - view: text, markup, annotated - select for diffs
Mon May 23 03:01:14 2005 UTC (20 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.65: preferred, colored
Changes since revision 1.65: +9 -11 lines
Avoid redundant relation lock grabs during planning, and make sure
that we acquire a lock on relations added to the query due to inheritance.
Formerly, no such lock was held throughout planning, which meant that
a schema change could occur to invalidate the plan before it's even
been completed.

Revision 1.65: download - view: text, markup, annotated - select for diffs
Fri Apr 22 21:58:31 2005 UTC (20 years, 4 months ago) by tgl
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +3 -2 lines
First cut at planner support for bitmap index scans.  Lots to do yet,
but the code is basically working.  Along the way, rewrite the entire
approach to processing OR index conditions, and make it work in join
cases for the first time ever.  orindxpath.c is now basically obsolete,
but I left it in for the time being to allow easy comparison testing
against the old implementation.

Revision 1.64: download - view: text, markup, annotated - select for diffs
Fri Dec 31 22:00:23 2004 UTC (20 years, 8 months ago) by pgsql
Branches: MAIN
CVS tags: REL8_0_9, REL8_0_8, REL8_0_7, REL8_0_6, REL8_0_5, REL8_0_4, REL8_0_3, REL8_0_2, REL8_0_13, REL8_0_12, REL8_0_11, REL8_0_10, REL8_0_1, REL8_0_0RC5, REL8_0_0RC4, REL8_0_0RC3, REL8_0_0
Branch point for: REL8_0_STABLE
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +2 -2 lines

Tag appropriate files for rc3

Also performed an initial run through of upgrading our Copyright date to
extend to 2005 ... first run here was very simple ... change everything
where: grep 1996-2004 && the word 'Copyright' ... scanned through the
generated list with 'less' first, and after, to make sure that I only
picked up the right entries ...

Revision 1.63: download - view: text, markup, annotated - select for diffs
Wed Dec 1 19:00:43 2004 UTC (20 years, 9 months ago) by tgl
Branches: MAIN
CVS tags: REL8_0_0RC2, REL8_0_0RC1
Diff to: previous 1.62: preferred, colored
Changes since revision 1.62: +6 -8 lines
Change planner to use the current true disk file size as its estimate of
a relation's number of blocks, rather than the possibly-obsolete value
in pg_class.relpages.  Scale the value in pg_class.reltuples correspondingly
to arrive at a hopefully more accurate number of rows.  When pg_class
contains 0/0, estimate a tuple width from the column datatypes and divide
that into current file size to estimate number of rows.  This improved
methodology allows us to jettison the ancient hacks that put bogus default
values into pg_class when a table is first created.  Also, per a suggestion
from Simon, make VACUUM (but not VACUUM FULL or ANALYZE) adjust the value
it puts into pg_class.reltuples to try to represent the mean tuple density
instead of the minimal density that actually prevails just after VACUUM.
These changes alter the plans selected for certain regression tests, so
update the expected files accordingly.  (I removed join_1.out because
it's not clear if it still applies; we can add back any variant versions
as they are shown to be needed.)

Revision 1.62: download - view: text, markup, annotated - select for diffs
Sun Aug 29 05:06:44 2004 UTC (21 years ago) by momjian
Branches: MAIN
CVS tags: REL8_0_0BETA5, REL8_0_0BETA4, REL8_0_0BETA3, REL8_0_0BETA2
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +4 -4 lines
Pgindent run for 8.0.

Revision 1.61: download - view: text, markup, annotated - select for diffs
Sun Aug 29 04:12:34 2004 UTC (21 years ago) by momjian
Branches: MAIN
Diff to: previous 1.60: preferred, colored
Changes since revision 1.60: +2 -2 lines
Update copyright to 2004.

Revision 1.60: download - view: text, markup, annotated - select for diffs
Sat Jun 5 01:55:05 2004 UTC (21 years, 3 months ago) by tgl
Branches: MAIN
CVS tags: REL8_0_0BETA1
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +4 -1 lines
Make the world very nearly safe for composite-type columns in tables.
1. Solve the problem of not having TOAST references hiding inside composite
values by establishing the rule that toasting only goes one level deep:
a tuple can contain toasted fields, but a composite-type datum that is
to be inserted into a tuple cannot.  Enforcing this in heap_formtuple
is relatively cheap and it avoids a large increase in the cost of running
the tuptoaster during final storage of a row.
2. Fix some interesting problems in expansion of inherited queries that
reference whole-row variables.  We never really did this correctly before,
but it's now relatively painless to solve by expanding the parent's
whole-row Var into a RowExpr() selecting the proper columns from the
child.
If you dike out the preventive check in CheckAttributeType(),
composite-type columns now seem to actually work.  However, we surely
cannot ship them like this --- without I/O for composite types, you
can't get pg_dump to dump tables containing them.  So a little more
work still to do.

Revision 1.59: download - view: text, markup, annotated - select for diffs
Tue Jun 1 03:03:02 2004 UTC (21 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +6 -6 lines
Desultory de-FastList-ification.  RelOptInfo.reltargetlist is back to
being a plain List.

Revision 1.58: download - view: text, markup, annotated - select for diffs
Sun May 30 23:40:31 2004 UTC (21 years, 3 months ago) by neilc
Branches: MAIN
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +11 -11 lines
Use the new List API function names throughout the backend, and disable the
list compatibility API by default. While doing this, I decided to keep
the llast() macro around and introduce llast_int() and llast_oid() variants.

Revision 1.57: download - view: text, markup, annotated - select for diffs
Wed May 26 04:41:27 2004 UTC (21 years, 3 months ago) by neilc
Branches: MAIN
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +23 -23 lines
Reimplement the linked list data structure used throughout the backend.

In the past, we used a 'Lispy' linked list implementation: a "list" was
merely a pointer to the head node of the list. The problem with that
design is that it makes lappend() and length() linear time. This patch
fixes that problem (and others) by maintaining a count of the list
length and a pointer to the tail node along with each head node pointer.
A "list" is now a pointer to a structure containing some meta-data
about the list; the head and tail pointers in that structure refer
to ListCell structures that maintain the actual linked list of nodes.

The function names of the list API have also been changed to, I hope,
be more logically consistent. By default, the old function names are
still available; they will be disabled-by-default once the rest of
the tree has been updated to use the new API names.

Revision 1.56: download - view: text, markup, annotated - select for diffs
Sun Apr 25 18:23:56 2004 UTC (21 years, 4 months ago) by neilc
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +1 -3 lines
Remove the last traces of Joe Hellerstein's "xfunc" optimization. Patch
from Alvaro Herrera. Also, removed lispsort.c, since it is no longer
used.

Revision 1.55: download - view: text, markup, annotated - select for diffs
Tue Feb 17 00:52:53 2004 UTC (21 years, 6 months ago) by tgl
Branches: MAIN
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +2 -6 lines
Make use of statistics on index expressions.  There are still some
corner cases that could stand improvement, but it does all the basic
stuff.  A byproduct is that the selectivity routines are no longer
constrained to working on simple Vars; we might in future be able to
improve the behavior for subexpressions that don't match indexes.

Revision 1.52.4.1: download - view: text, markup, annotated - select for diffs
Mon Dec 8 18:20:10 2003 UTC (21 years, 9 months ago) by tgl
Branches: REL7_4_STABLE
CVS tags: REL7_4_9, REL7_4_8, REL7_4_7, REL7_4_6, REL7_4_5, REL7_4_4, REL7_4_3, REL7_4_2, REL7_4_17, REL7_4_16, REL7_4_15, REL7_4_14, REL7_4_13, REL7_4_12, REL7_4_11, REL7_4_10, REL7_4_1
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +8 -14 lines
Whole-row references were broken for subqueries and functions, because
attr_needed/attr_widths optimization failed to allow for Vars with attno
zero in this case.  Per report from Tatsuo Ishii.

Revision 1.54: download - view: text, markup, annotated - select for diffs
Mon Dec 8 18:19:58 2003 UTC (21 years, 9 months ago) by tgl
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +8 -14 lines
Whole-row references were broken for subqueries and functions, because
attr_needed/attr_widths optimization failed to allow for Vars with attno
zero in this case.  Per report from Tatsuo Ishii.

Revision 1.53: download - view: text, markup, annotated - select for diffs
Sat Nov 29 19:51:51 2003 UTC (21 years, 9 months ago) by pgsql
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +1 -1 lines

$Header: -> $PostgreSQL Changes ...

Revision 1.52: download - view: text, markup, annotated - select for diffs
Mon Aug 4 02:40:01 2003 UTC (22 years, 1 month ago) by momjian
Branches: MAIN
CVS tags: WIN32_DEV, REL7_4_RC2, REL7_4_RC1, REL7_4_BETA5, REL7_4_BETA4, REL7_4_BETA3, REL7_4_BETA2, REL7_4_BETA1, REL7_4
Branch point for: REL7_4_STABLE
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +2 -2 lines
Update copyrights to 2003.

Revision 1.51: download - view: text, markup, annotated - select for diffs
Mon Aug 4 00:43:20 2003 UTC (22 years, 1 month ago) by momjian
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +5 -4 lines
pgindent run.

Revision 1.50: download - view: text, markup, annotated - select for diffs
Fri Jul 25 00:01:08 2003 UTC (22 years, 1 month ago) by tgl
Branches: MAIN
Diff to: previous 1.49: preferred, colored
Changes since revision 1.49: +6 -6 lines
Error message editing in backend/optimizer, backend/rewrite.

Revision 1.49: download - view: text, markup, annotated - select for diffs
Sun Jun 29 23:05:04 2003 UTC (22 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +64 -53 lines
Restructure building of join relation targetlists so that a join plan
node emits only those vars that are actually needed above it in the
plan tree.  (There were comments in the code suggesting that this was
done at some point in the dim past, but for a long time we have just
made join nodes emit everything that either input emitted.)  Aside from
being marginally more efficient, this fixes the problem noted by Peter
Eisentraut where a join above an IN-implemented-as-join might fail,
because the subplan targetlist constructed in the latter case didn't
meet the expectation of including everything.
Along the way, fix some places that were O(N^2) in the targetlist
length.  This is not all the trouble spots for wide queries by any
means, but it's a step forward.

Revision 1.48: download - view: text, markup, annotated - select for diffs
Sat Feb 15 20:12:40 2003 UTC (22 years, 6 months ago) by tgl
Branches: MAIN
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +3 -3 lines
Teach planner how to propagate pathkeys from sub-SELECTs in FROM up to
the outer query.  (The implementation is a bit klugy, but it would take
nontrivial restructuring to make it nicer, which this is probably not
worth.)  This avoids unnecessary sort steps in examples like
SELECT foo,count(*) FROM (SELECT ... ORDER BY foo,bar) sub GROUP BY foo
which means there is now a reasonable technique for controlling the
order of inputs to custom aggregates, even in the grouping case.

Revision 1.47: download - view: text, markup, annotated - select for diffs
Sat Feb 8 20:20:55 2003 UTC (22 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +24 -30 lines
Replace planner's representation of relation sets, per pghackers discussion.
Instead of Lists of integers, we now store variable-length bitmap sets.
This should be faster as well as less error-prone.

Revision 1.46: download - view: text, markup, annotated - select for diffs
Mon Feb 3 15:07:07 2003 UTC (22 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.45: preferred, colored
Changes since revision 1.45: +6 -11 lines
Tweak planner and executor to avoid doing ExecProject() in table scan
nodes where it's not really necessary.  In many cases where the scan node
is not the topmost plan node (eg, joins, aggregation), it's possible to
just return the table tuple directly instead of generating an intermediate
projection tuple.  In preliminary testing, this reduced the CPU time
needed for 'SELECT COUNT(*) FROM foo' by about 10%.

Revision 1.45: download - view: text, markup, annotated - select for diffs
Fri Jan 24 03:58:43 2003 UTC (22 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +9 -4 lines
Modify planner's implied-equality-deduction code so that when a set
of known-equal expressions includes any constant expressions (including
Params from outer queries), we actively suppress any 'var = var'
clauses that are or could be deduced from the set, generating only the
deducible 'var = const' clauses instead.  The idea here is to push down
the restrictions implied by the equality set to base relations whenever
possible.  Once we have applied the 'var = const' clauses, the 'var = var'
clauses are redundant, and should be suppressed both to save work at
execution and to avoid double-counting restrictivity.

Revision 1.44: download - view: text, markup, annotated - select for diffs
Mon Jan 20 18:54:56 2003 UTC (22 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +7 -11 lines
IN clauses appearing at top level of WHERE can now be handled as joins.
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.

Revision 1.43: download - view: text, markup, annotated - select for diffs
Wed Jan 15 19:35:44 2003 UTC (22 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +4 -81 lines
Allow merge and hash joins to occur on arbitrary expressions (anything not
containing a volatile function), rather than only on 'Var = Var' clauses
as before.  This makes it practical to do flatten_join_alias_vars at the
start of planning, which in turn eliminates a bunch of klugery inside the
planner to deal with alias vars.  As a free side effect, we now detect
implied equality of non-Var expressions; for example in
	SELECT ... WHERE a.x = b.y and b.y = 42
we will deduce a.x = 42 and use that as a restriction qual on a.  Also,
we can remove the restriction introduced 12/5/02 to prevent pullup of
subqueries whose targetlists contain sublinks.
Still TODO: make statistical estimation routines in selfuncs.c and costsize.c
smarter about expressions that are more complex than plain Vars.  The need
for this is considerably greater now that we have to be able to estimate
the suitability of merge and hash join techniques on such expressions.

Revision 1.42: download - view: text, markup, annotated - select for diffs
Sun Jan 12 22:35:29 2003 UTC (22 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +5 -3 lines
Revise cost_qual_eval() to compute both startup (one-time) and per-tuple
costs for expression evaluation, not only per-tuple cost as before.
This extension is needed in order to deal realistically with hashed or
materialized sub-selects.

Revision 1.41: download - view: text, markup, annotated - select for diffs
Sun Nov 24 21:52:14 2002 UTC (22 years, 9 months ago) by tgl
Branches: MAIN
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +8 -58 lines
Restructure planning of nestloop inner indexscans so that the set of usable
joinclauses is determined accurately for each join.  Formerly, the code only
considered joinclauses that used all of the rels from the outer side of the
join; thus for example
	FROM (a CROSS JOIN b) JOIN c ON (c.f1 = a.x AND c.f2 = b.y)
could not exploit a two-column index on c(f1,f2), since neither of the
qual clauses would be in the joininfo list it looked in.  The new code does
this correctly, and also is able to eliminate redundant clauses, thus fixing
the problem noted 24-Oct-02 by Hans-Jürgen Schönig.

Revision 1.40: download - view: text, markup, annotated - select for diffs
Sat Oct 12 22:24:49 2002 UTC (22 years, 11 months ago) by tgl
Branches: MAIN
CVS tags: REL7_3_STABLE, REL7_3_9, REL7_3_8, REL7_3_7, REL7_3_6, REL7_3_5, REL7_3_4, REL7_3_21, REL7_3_20, REL7_3_2, REL7_3_19, REL7_3_18, REL7_3_17, REL7_3_16, REL7_3_15, REL7_3_14, REL7_3_13, REL7_3_12, REL7_3_11, REL7_3_10
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +18 -6 lines
Fix for bug #795: two clauses that seem redundant are not really, if
one is pushed down into an outer join and the other is not.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Wed Sep 4 20:31:22 2002 UTC (23 years ago) by momjian
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +18 -18 lines
pgindent run.

Revision 1.38: download - view: text, markup, annotated - select for diffs
Thu Jun 20 20:29:31 2002 UTC (23 years, 2 months ago) by momjian
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +2 -2 lines
Update copyright to 2002.

Revision 1.37: download - view: text, markup, annotated - select for diffs
Sun May 12 20:10:03 2002 UTC (23 years, 4 months ago) by tgl
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +5 -5 lines
First pass at set-returning-functions in FROM, by Joe Conway with
some kibitzing from Tom Lane.  Not everything works yet, and there's
no documentation or regression test, but let's commit this so Joe
doesn't need to cope with tracking changes in so many files ...

Revision 1.36: download - view: text, markup, annotated - select for diffs
Tue Mar 12 00:51:51 2002 UTC (23 years, 6 months ago) by tgl
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +119 -31 lines
Restructure representation of join alias variables.  An explicit JOIN
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.

Revision 1.35: download - view: text, markup, annotated - select for diffs
Thu Oct 25 05:49:34 2001 UTC (23 years, 10 months ago) by momjian
Branches: MAIN
CVS tags: REL7_2_STABLE, REL7_2_RC2, REL7_2_RC1, REL7_2_BETA5, REL7_2_BETA4, REL7_2_BETA3, REL7_2_BETA2, REL7_2_BETA1, REL7_2_8, REL7_2_7, REL7_2_6, REL7_2_5, REL7_2_4, REL7_2_3, REL7_2
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +16 -16 lines
pgindent run on all C files.  Java run to follow.  initdb/regression
tests pass.

Revision 1.34: download - view: text, markup, annotated - select for diffs
Thu Oct 18 16:11:42 2001 UTC (23 years, 10 months ago) by tgl
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +85 -17 lines
Extend code that deduces implied equality clauses to detect whether a
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.

Revision 1.33: download - view: text, markup, annotated - select for diffs
Sun May 20 20:28:19 2001 UTC (24 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.32: preferred, colored
Changes since revision 1.32: +108 -27 lines
Modify optimizer data structures so that IndexOptInfo lists built for
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!

Revision 1.32: download - view: text, markup, annotated - select for diffs
Fri Feb 16 00:03:08 2001 UTC (24 years, 6 months ago) by tgl
Branches: MAIN
CVS tags: REL7_1_STABLE, REL7_1_2, REL7_1
Diff to: previous 1.31: preferred, colored
Changes since revision 1.31: +4 -2 lines
Take OUTER JOIN semantics into account when estimating the size of join
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 ...

Revision 1.31: download - view: text, markup, annotated - select for diffs
Wed Jan 24 19:43:00 2001 UTC (24 years, 7 months ago) by momjian
Branches: MAIN
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +2 -2 lines
Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.

Revision 1.30: download - view: text, markup, annotated - select for diffs
Sun Nov 12 00:36:59 2000 UTC (24 years, 10 months ago) by tgl
Branches: MAIN
CVS tags: REL7_1_BETA3, REL7_1_BETA2, REL7_1_BETA
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +25 -5 lines
Restructure handling of inheritance queries so that they work with outer
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.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Fri Sep 29 18:21:23 2000 UTC (24 years, 11 months ago) by tgl
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +24 -7 lines
Subselects in FROM clause, per ISO syntax: FROM (SELECT ...) [AS] alias.
(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!

Revision 1.28: download - view: text, markup, annotated - select for diffs
Tue Sep 12 21:06:58 2000 UTC (25 years ago) by tgl
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +4 -3 lines
First cut at full support for OUTER JOINs.  There are still a few loose
ends to clean up (see my message of same date to pghackers), but mostly
it works.  INITDB REQUIRED!

Revision 1.27: download - view: text, markup, annotated - select for diffs
Sun Jun 18 22:44:12 2000 UTC (25 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +4 -22 lines
Reimplement nodeMaterial to use a temporary BufFile (or even memory, if the
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.

Revision 1.26: download - view: text, markup, annotated - select for diffs
Wed Apr 12 17:15:24 2000 UTC (25 years, 5 months ago) by momjian
Branches: MAIN
CVS tags: REL7_0_PATCHES, REL7_0
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +46 -35 lines
Ye-old pgindent run.  Same 4-space tabs.

Revision 1.25: download - view: text, markup, annotated - select for diffs
Fri Feb 18 23:47:31 2000 UTC (25 years, 6 months ago) by tgl
Branches: MAIN
Diff to: previous 1.24: preferred, colored
Changes since revision 1.24: +2 -5 lines
Plug some more memory leaks in the planner.  It still leaks like a sieve,
but this is as good as it'll get for this release...

Revision 1.24: download - view: text, markup, annotated - select for diffs
Tue Feb 15 20:49:21 2000 UTC (25 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +7 -3 lines
New cost model for planning, incorporating a penalty for random page
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.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Mon Feb 7 04:41:02 2000 UTC (25 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +356 -57 lines
Repair planning bugs caused by my misguided removal of restrictinfo link
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'.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Sun Feb 6 03:27:33 2000 UTC (25 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +7 -11 lines
Rename same() to sameseti() to have a slightly less generic name.  Move
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.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Wed Jan 26 05:56:40 2000 UTC (25 years, 7 months ago) by momjian
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +3 -2 lines
Add:

  * Portions Copyright (c) 1996-2000, PostgreSQL, Inc

to all files copyright Regents of Berkeley.  Man, that's a lot of files.

Revision 1.20: download - view: text, markup, annotated - select for diffs
Sun Jan 9 00:26:41 2000 UTC (25 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.19: preferred, colored
Changes since revision 1.19: +5 -11 lines
Another round of planner/optimizer work.  This is just restructuring and
code cleanup; no major improvements yet.  However, EXPLAIN does produce
more intuitive outputs for nested loops with indexscans now...

Revision 1.19: download - view: text, markup, annotated - select for diffs
Mon Aug 16 02:17:58 1999 UTC (26 years, 1 month ago) by tgl
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +15 -24 lines
Major planner/optimizer revision: get rid of PathOrder node type,
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.

Revision 1.16.2.1: download - view: text, markup, annotated - select for diffs
Mon Aug 2 06:27:08 1999 UTC (26 years, 1 month ago) by scrappy
Branches: REL6_5_PATCHES
Diff to: previous 1.16: preferred, colored; next MAIN 1.17: preferred, colored
Changes since revision 1.16: +2 -6 lines

Final round before bed...more tomorrow...

Revision 1.18: download - view: text, markup, annotated - select for diffs
Fri Jul 16 03:13:05 1999 UTC (26 years, 2 months ago) by momjian
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +2 -2 lines
Update #include cleanups

Revision 1.17: download - view: text, markup, annotated - select for diffs
Thu Jul 15 22:39:32 1999 UTC (26 years, 2 months ago) by momjian
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +1 -2 lines
Remove unused #includes in *.c files.

Revision 1.16: download - view: text, markup, annotated - select for diffs
Tue May 25 16:10:01 1999 UTC (26 years, 3 months ago) by momjian
Branches: MAIN
CVS tags: REL6_5
Branch point for: REL6_5_PATCHES
Diff to: previous 1.15: preferred, colored
Changes since revision 1.15: +4 -2 lines
pgindent run over code.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Thu Feb 18 00:49:38 1999 UTC (26 years, 6 months ago) by momjian
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +7 -10 lines
Fix bushy plans.  Cleanup.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Mon Feb 15 03:22:17 1999 UTC (26 years, 7 months ago) by momjian
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +1 -3 lines
Remove duplicate geqo functions, and more optimizer cleanup

Revision 1.13: download - view: text, markup, annotated - select for diffs
Sat Feb 13 23:16:48 1999 UTC (26 years, 7 months ago) by momjian
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +5 -5 lines
Change my-function-name-- to my_function_name, and optimizer renames.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Fri Feb 12 05:56:58 1999 UTC (26 years, 7 months ago) by momjian
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +1 -2 lines
Fix optimizer and make faster.

Revision 1.11: download - view: text, markup, annotated - select for diffs
Tue Feb 9 17:03:01 1999 UTC (26 years, 7 months ago) by momjian
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +3 -3 lines
Rename Temp to Noname for noname tables.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Wed Feb 3 20:15:43 1999 UTC (26 years, 7 months ago) by momjian
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +2 -2 lines
Optimizer rename ClauseInfo -> RestrictInfo.  Update optimizer README.

Revision 1.9: download - view: text, markup, annotated - select for diffs
Tue Sep 1 04:30:11 1998 UTC (27 years ago) by momjian
Branches: MAIN
CVS tags: REL6_4
Diff to: previous 1.8: preferred, colored
Changes since revision 1.8: +3 -2 lines
OK, folks, here is the pgindent output.

Revision 1.8: download - view: text, markup, annotated - select for diffs
Tue Sep 1 03:23:58 1998 UTC (27 years ago) by momjian
Branches: MAIN
Diff to: previous 1.7: preferred, colored
Changes since revision 1.7: +3 -3 lines
Renaming cleanup, no pgindent yet.

Revision 1.7: download - view: text, markup, annotated - select for diffs
Mon Aug 10 02:26:32 1998 UTC (27 years, 1 month ago) by momjian
Branches: MAIN
Diff to: previous 1.6: preferred, colored
Changes since revision 1.6: +4 -6 lines
Cleanup optimizer function names and clarify code.

Revision 1.6: download - view: text, markup, annotated - select for diffs
Sat Jul 18 04:22:41 1998 UTC (27 years, 2 months ago) by momjian
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +8 -8 lines
Rename Rel to RelOptInfo.

Revision 1.5: download - view: text, markup, annotated - select for diffs
Thu Feb 26 04:33:21 1998 UTC (27 years, 6 months ago) by momjian
Branches: MAIN
CVS tags: release-6-3
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +4 -4 lines
pgindent run before 6.3 release, with Thomas' requested changes.

Revision 1.4: download - view: text, markup, annotated - select for diffs
Mon Sep 8 21:45:54 1997 UTC (28 years ago) by momjian
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +4 -4 lines
Used modified version of indent that understands over 100 typedefs.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Mon Sep 8 02:25:02 1997 UTC (28 years ago) by momjian
Branches: MAIN
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +11 -11 lines
Another PGINDENT run that changes variable indenting and case label indenting.  Also static variable indenting.

Revision 1.2: download - view: text, markup, annotated - select for diffs
Sun Sep 7 04:44:32 1997 UTC (28 years ago) by momjian
Branches: MAIN
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +96 -86 lines
Massive commit to run PGINDENT on all *.c and *.h files.

Revision 1.1.1.1 (vendor branch): download - view: text, markup, annotated - select for diffs
Tue Jul 9 06:21:39 1996 UTC (29 years, 2 months ago) by scrappy
Branches: PG95_DIST
CVS tags: Release_2_0_0, Release_2_0, Release_1_0_3, Release_1_0_2, REL2_0B, REL2_0, PG95-1_01
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +0 -0 lines
Postgres95 1.01 Distribution - Virgin Sources

Revision 1.1: download - view: text, markup, annotated - select for diffs
Tue Jul 9 06:21:39 1996 UTC (29 years, 2 months ago) by scrappy
Branches: MAIN
Initial revision

Diff request

This form allows you to request diffs between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.

Log view options

PostgreSQL CVSweb <webmaster@postgresql.org>