CVS log for pgsql/src/backend/optimizer/util/plancat.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.164: download - view: text, markup, annotated - select for diffs
Fri Aug 27 20:30:08 2010 UTC (15 years ago) by petere
Branches: MAIN
CVS tags: REL9_1_ALPHA1, HEAD
Diff to: previous 1.163: preferred, colored
Changes since revision 1.163: +2 -6 lines
Small refactoring of makeVar() from a TargetEntry

Revision 1.158.2.1: download - view: text, markup, annotated - select for diffs
Tue Mar 30 21:58:18 2010 UTC (15 years, 5 months ago) by tgl
Branches: REL8_4_STABLE
CVS tags: REL8_4_4
Diff to: previous 1.158: preferred, colored; next MAIN 1.159: preferred, colored
Changes since revision 1.158: +5 -2 lines
Fix "constraint_exclusion = partition" logic so that it will also attempt
constraint exclusion on an inheritance set that is the target of an UPDATE
or DELETE query.  Per gripe from Marc Cousin.  Back-patch to 8.4 where
the feature was introduced.

Revision 1.163: download - view: text, markup, annotated - select for diffs
Tue Mar 30 21:58:10 2010 UTC (15 years, 5 months ago) by tgl
Branches: MAIN
CVS tags: 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
Diff to: previous 1.162: preferred, colored
Changes since revision 1.162: +5 -2 lines
Fix "constraint_exclusion = partition" logic so that it will also attempt
constraint exclusion on an inheritance set that is the target of an UPDATE
or DELETE query.  Per gripe from Marc Cousin.  Back-patch to 8.4 where
the feature was introduced.

Revision 1.162: download - view: text, markup, annotated - select for diffs
Tue Jan 5 21:53:58 2010 UTC (15 years, 8 months ago) by rhaas
Branches: MAIN
CVS tags: REL9_0_ALPHA4_BRANCH, REL9_0_ALPHA4
Diff to: previous 1.161: preferred, colored
Changes since revision 1.161: +4 -1 lines
Support ALTER TABLESPACE name SET/RESET ( tablespace_options ).

This patch only supports seq_page_cost and random_page_cost as parameters,
but it provides the infrastructure to scalably support many more.
In particular, we may want to add support for effective_io_concurrency,
but I'm leaving that as future work for now.

Thanks to Tom Lane for design help and Alvaro Herrera for the review.

Revision 1.161: 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
Diff to: previous 1.160: preferred, colored
Changes since revision 1.160: +2 -2 lines
Update copyright for the year 2010.

Revision 1.160: download - view: text, markup, annotated - select for diffs
Fri Jan 1 23:03:10 2010 UTC (15 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.159: preferred, colored
Changes since revision 1.159: +2 -1 lines
Add an "argisrow" field to NullTest nodes, following a plan made way back in
8.2beta but never carried out.  This avoids repetitive tests of whether the
argument is of scalar or composite type.  Also, be a bit more paranoid about
composite arguments in some places where we previously weren't checking.

Revision 1.159: download - view: text, markup, annotated - select for diffs
Thu Jul 16 06:33:43 2009 UTC (16 years, 1 month ago) by petere
Branches: MAIN
CVS tags: REL8_5_ALPHA3_BRANCH, REL8_5_ALPHA3, REL8_5_ALPHA2_BRANCH, REL8_5_ALPHA2, REL8_5_ALPHA1_BRANCH, REL8_5_ALPHA1
Diff to: previous 1.158: preferred, colored
Changes since revision 1.158: +7 -7 lines
Make backend header files C++ safe

This alters various incidental uses of C++ key words to use other similar
identifiers, so that a C++ compiler won't choke outright.  You still
(probably) need extern "C" { }; around the inclusion of backend headers.

based on a patch by Kurt Harriman <harriman@acm.org>

Also add a script cpluspluscheck to check for C++ compatibility in the
future.  As of right now, this passes without error for me.

Revision 1.158: 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_4_RC2, REL8_4_RC1, REL8_4_3, REL8_4_2, REL8_4_1, REL8_4_0
Branch point for: REL8_4_STABLE
Diff to: previous 1.157: preferred, colored
Changes since revision 1.157: +8 -8 lines
8.4 pgindent run, with new combined Linux/FreeBSD/MinGW typedef list
provided by Andrew.

Revision 1.157: download - view: text, markup, annotated - select for diffs
Tue May 12 00:56:05 2009 UTC (16 years, 4 months ago) by tgl
Branches: MAIN
CVS tags: REL8_4_BETA2
Diff to: previous 1.156: preferred, colored
Changes since revision 1.156: +1 -78 lines
Do some minor code refactoring in preparation for changing the APIs of
find_inheritance_children() and find_all_inheritors().  I got annoyed that
these are buried inside the planner but mostly used elsewhere.  So, create
a new file catalog/pg_inherits.c and put them there, along with a couple
of other functions that search pg_inherits.

The code that modifies pg_inherits is (still) in tablecmds.c --- it's
kind of entangled with unrelated code that modifies pg_depend and other
stuff, so pulling it out seemed like a bigger change than I wanted to make
right now.  But this file provides a natural home for it if anyone ever
gets around to that.

This commit just moves code around; it doesn't change anything, except
I succumbed to the temptation to make a couple of trivial optimizations
in typeInheritsFrom().

Revision 1.156: download - view: text, markup, annotated - select for diffs
Thu Mar 5 23:06:45 2009 UTC (16 years, 6 months ago) by tgl
Branches: MAIN
CVS tags: REL8_4_BETA1
Diff to: previous 1.155: preferred, colored
Changes since revision 1.155: +3 -1 lines
Teach the planner to support index access methods that only implement
amgettuple or only implement amgetbitmap, instead of the former assumption
that every AM supports both APIs.  Extracted with minor editorialization
from Teodor's fast-GIN-insert patch; whatever becomes of that, this seems
like a simple and reasonable generalization of the index AM interface spec.

Revision 1.155: download - view: text, markup, annotated - select for diffs
Sun Feb 15 20:16:21 2009 UTC (16 years, 6 months ago) by tgl
Branches: MAIN
Diff to: previous 1.154: preferred, colored
Changes since revision 1.154: +7 -6 lines
Teach the planner to treat a partial unique index as proving a variable is
unique for a particular query, if the index predicate is satisfied.  This
requires a bit of reordering of operations so that we check the predicates
before doing any selectivity estimates, but shouldn't really cause any
noticeable slowdown.  Per a comment from Michal Politowski.

Revision 1.154: download - view: text, markup, annotated - select for diffs
Wed Jan 7 22:40:49 2009 UTC (16 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.153: preferred, colored
Changes since revision 1.153: +10 -6 lines
Create a third option named "partition" for constraint_exclusion, and make it
the default.  This setting enables constraint exclusion checks only for
appendrel members (ie, inheritance children and UNION ALL arms), which are
the cases in which constraint exclusion is most likely to be useful.  Avoiding
the overhead for simple queries that are unlikely to benefit should bring
the cost down to the point where this is a reasonable default setting.
Per today's discussion.

Revision 1.153: 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
Diff to: previous 1.152: preferred, colored
Changes since revision 1.152: +2 -2 lines
Update copyright for 2009.

Revision 1.152: 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.151: preferred, colored
Changes since revision 1.151: +6 -18 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.151: download - view: text, markup, annotated - select for diffs
Mon Sep 1 20:42:44 2008 UTC (17 years ago) by tgl
Branches: MAIN
Diff to: previous 1.150: preferred, colored
Changes since revision 1.150: +3 -3 lines
Add a bunch of new error location reports to parse-analysis error messages.
There are still some weak spots around JOIN USING and relation alias lists,
but most errors reported within backend/parser/ now have locations.

Revision 1.150: download - view: text, markup, annotated - select for diffs
Mon Aug 25 22:42:33 2008 UTC (17 years ago) by tgl
Branches: MAIN
Diff to: previous 1.149: preferred, colored
Changes since revision 1.149: +2 -2 lines
Move exprType(), exprTypmod(), expression_tree_walker(), and related routines
into nodes/nodeFuncs, so as to reduce wanton cross-subsystem #includes inside
the backend.  There's probably more that should be done along this line,
but this is a start anyway.

Revision 1.149: download - view: text, markup, annotated - select for diffs
Sat Aug 16 00:01:36 2008 UTC (17 years ago) by tgl
Branches: MAIN
Diff to: previous 1.148: preferred, colored
Changes since revision 1.148: +6 -4 lines
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.

Revision 1.148: download - view: text, markup, annotated - select for diffs
Sun Jul 13 20:45:47 2008 UTC (17 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.147: preferred, colored
Changes since revision 1.147: +2 -2 lines
Clean up the use of some page-header-access macros: principally, use
SizeOfPageHeaderData instead of sizeof(PageHeaderData) in places where that
makes the code clearer, and avoid casting between Page and PageHeader where
possible.  Zdenek Kotala, with some additional cleanup by Heikki Linnakangas.

I did not apply the parts of the proposed patch that would have resulted in
slightly changing the on-disk format of hash indexes; it seems to me that's
not a win as long as there's any chance of having in-place upgrade for 8.4.

Revision 1.147: download - view: text, markup, annotated - select for diffs
Thu Jun 19 00:46:04 2008 UTC (17 years, 2 months ago) by alvherre
Branches: MAIN
Diff to: previous 1.146: preferred, colored
Changes since revision 1.146: +2 -2 lines
Improve our #include situation by moving pointer types away from the
corresponding struct definitions.  This allows other headers to avoid including
certain highly-loaded headers such as rel.h and relscan.h, instead using just
relcache.h, heapam.h or genam.h, which are more lightweight and thus cause less
unnecessary dependencies.

Revision 1.146: download - view: text, markup, annotated - select for diffs
Mon May 12 00:00:49 2008 UTC (17 years, 4 months ago) by alvherre
Branches: MAIN
Diff to: previous 1.145: preferred, colored
Changes since revision 1.145: +3 -1 lines
Restructure some header files a bit, in particular heapam.h, by removing some
unnecessary #include lines in it.  Also, move some tuple routine prototypes and
macros to htup.h, which allows removal of heapam.h inclusion from some .c
files.

For this to work, a new header file access/sysattr.h needed to be created,
initially containing attribute numbers of system columns, for pg_dump usage.

While at it, make contrib ltree, intarray and hstore header files more
consistent with our header style.

Revision 1.140.2.1: download - view: text, markup, annotated - select for diffs
Tue Apr 1 00:48:44 2008 UTC (17 years, 5 months ago) by tgl
Branches: REL8_3_STABLE
CVS tags: 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
Diff to: previous 1.140: preferred, colored; next MAIN 1.141: preferred, colored
Changes since revision 1.140: +9 -6 lines
Fix an oversight I made in a cleanup patch over a year ago:
eval_const_expressions needs to be passed the PlannerInfo ("root") structure,
because in some cases we want it to substitute values for Param nodes.
(So "constant" is not so constant as all that ...)  This mistake partially
disabled optimization of unnamed extended-Query statements in 8.3: in
particular the LIKE-to-indexscan optimization would never be applied if the
LIKE pattern was passed as a parameter, and constraint exclusion depending
on a parameter value didn't work either.

Revision 1.145: download - view: text, markup, annotated - select for diffs
Tue Apr 1 00:48:33 2008 UTC (17 years, 5 months ago) by tgl
Branches: MAIN
Diff to: previous 1.144: preferred, colored
Changes since revision 1.144: +9 -6 lines
Fix an oversight I made in a cleanup patch over a year ago:
eval_const_expressions needs to be passed the PlannerInfo ("root") structure,
because in some cases we want it to substitute values for Param nodes.
(So "constant" is not so constant as all that ...)  This mistake partially
disabled optimization of unnamed extended-Query statements in 8.3: in
particular the LIKE-to-indexscan optimization would never be applied if the
LIKE pattern was passed as a parameter, and constraint exclusion depending
on a parameter value didn't work either.

Revision 1.144: download - view: text, markup, annotated - select for diffs
Wed Mar 26 21:10:38 2008 UTC (17 years, 5 months ago) by alvherre
Branches: MAIN
Diff to: previous 1.143: preferred, colored
Changes since revision 1.143: +4 -3 lines
Move the HTSU_Result enum definition into snapshot.h, to avoid including
tqual.h into heapam.h.  This makes all inclusion of tqual.h explicit.

I also sorted alphabetically the includes on some source files.

Revision 1.143: download - view: text, markup, annotated - select for diffs
Wed Mar 26 18:48:59 2008 UTC (17 years, 5 months ago) by alvherre
Branches: MAIN
Diff to: previous 1.142: preferred, colored
Changes since revision 1.142: +2 -2 lines
Rename snapmgmt.c/h to snapmgr.c/h, for consistency with other files.
Per complaint from Tom Lane.

Revision 1.142: download - view: text, markup, annotated - select for diffs
Wed Mar 26 16:20:47 2008 UTC (17 years, 5 months ago) by alvherre
Branches: MAIN
Diff to: previous 1.141: preferred, colored
Changes since revision 1.141: +2 -1 lines
Separate snapshot management code from tuple visibility code, create a
snapmgmt.c file for the former.  The header files have also been reorganized
in three parts: the most basic snapshot definitions are now in a new file
snapshot.h, and the also new snapmgmt.h keeps the definitions for snapmgmt.c.
tqual.h has been reduced to the bare minimum.

This patch is just a first step towards managing live snapshots within a
transaction; there is no functionality change.

Per my proposal to pgsql-patches on 20080318191940.GB27458@alvh.no-ip.org and
subsequent discussion.

Revision 1.141: download - view: text, markup, annotated - select for diffs
Sat Mar 15 20:46:31 2008 UTC (17 years, 5 months ago) by tgl
Branches: MAIN
Diff to: previous 1.140: preferred, colored
Changes since revision 1.140: +2 -4 lines
Change hash index creation so that rather than always establishing exactly
two buckets at the start, we create a number of buckets appropriate for the
estimated size of the table.  This avoids a lot of expensive bucket-split
actions during initial index build on an already-populated table.

This is one of the two core ideas of Tom Raney and Shreya Bhargava's patch
to reduce hash index build time.  I'm committing it separately to make it
easier for people to test the effects of this separately from the effects
of their other core idea (pre-sorting the index entries by bucket number).

Revision 1.127.2.1: download - view: text, markup, annotated - select for diffs
Sat Jan 12 00:11:45 2008 UTC (17 years, 8 months ago) by tgl
Branches: REL8_2_STABLE
CVS tags: REL8_2_9, REL8_2_8, REL8_2_7, 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.127: preferred, colored; next MAIN 1.128: preferred, colored
Changes since revision 1.127: +37 -5 lines
Fix logical errors in constraint exclusion: we cannot assume that a CHECK
constraint yields TRUE for every row of its table, only that it does not
yield FALSE (a NULL result isn't disallowed).  This breaks a couple of
implications that would be true in two-valued logic.  I had put in one such
mistake in an 8.2.5 patch: foo IS NULL doesn't refute a strict operator
on foo.  But there was another in the original 8.2 release: NOT foo doesn't
refute an expression whose truth would imply the truth of foo.
Per report from Rajesh Kumar Mallah.

To preserve the ability to do constraint exclusion with one partition
holding NULL values, extend relation_excluded_by_constraints() to check
for attnotnull flags, and add col IS NOT NULL expressions to the set of
constraints we hope to refute.

Revision 1.140: download - view: text, markup, annotated - select for diffs
Sat Jan 12 00:11:39 2008 UTC (17 years, 8 months ago) by tgl
Branches: MAIN
CVS tags: REL8_3_RC2, REL8_3_1, REL8_3_0
Branch point for: REL8_3_STABLE
Diff to: previous 1.139: preferred, colored
Changes since revision 1.139: +37 -5 lines
Fix logical errors in constraint exclusion: we cannot assume that a CHECK
constraint yields TRUE for every row of its table, only that it does not
yield FALSE (a NULL result isn't disallowed).  This breaks a couple of
implications that would be true in two-valued logic.  I had put in one such
mistake in an 8.2.5 patch: foo IS NULL doesn't refute a strict operator
on foo.  But there was another in the original 8.2 release: NOT foo doesn't
refute an expression whose truth would imply the truth of foo.
Per report from Rajesh Kumar Mallah.

To preserve the ability to do constraint exclusion with one partition
holding NULL values, extend relation_excluded_by_constraints() to check
for attnotnull flags, and add col IS NOT NULL expressions to the set of
constraints we hope to refute.

Revision 1.139: 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_RC1
Diff to: previous 1.138: preferred, colored
Changes since revision 1.138: +2 -2 lines
Update copyrights in source tree to 2008.

Revision 1.138: 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.137: preferred, colored
Changes since revision 1.137: +12 -11 lines
pgindent run for 8.3.

Revision 1.137: download - view: text, markup, annotated - select for diffs
Thu Sep 20 17:56:31 2007 UTC (17 years, 11 months ago) by tgl
Branches: MAIN
CVS tags: REL8_3_BETA2, REL8_3_BETA1
Diff to: previous 1.136: preferred, colored
Changes since revision 1.136: +16 -1 lines
HOT updates.  When we update a tuple without changing any of its indexed
columns, and the new version can be stored on the same heap page, we no longer
generate extra index entries for the new version.  Instead, index searches
follow the HOT-chain links to ensure they find the correct tuple version.

In addition, this patch introduces the ability to "prune" dead tuples on a
per-page basis, without having to do a complete VACUUM pass to recover space.
VACUUM is still needed to clean up dead index entries, however.

Pavan Deolasee, with help from a bunch of other people.

Revision 1.136: download - view: text, markup, annotated - select for diffs
Thu May 31 16:57:34 2007 UTC (18 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.135: preferred, colored
Changes since revision 1.135: +11 -8 lines
Change build_index_pathkeys() so that the expressions it builds to represent
index key columns always have the type expected by the index's associated
operators, ie, we add RelabelType nodes when dealing with binary-compatible
index opclasses.  This is needed to get varchar indexes to play nicely with
the new EquivalenceClass machinery, as per recent gripe from Josh Berkus that
CVS HEAD was failing to match a varchar index column to a constant restriction
in the query.

It seems likely that this change will allow removal of a lot of ugly ad-hoc
RelabelType-stripping that the planner has traditionally done while matching
expressions to other expressions, but I'll worry about that some other day.

Revision 1.135: download - view: text, markup, annotated - select for diffs
Fri May 25 17:54:25 2007 UTC (18 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.134: preferred, colored
Changes since revision 1.134: +12 -1 lines
Create hooks to let a loadable plugin monitor (or even replace) the planner
and/or create plans for hypothetical situations; in particular, investigate
plans that would be generated using hypothetical indexes.  This is a
heavily-rewritten version of the hooks proposed by Gurjeet Singh for his
Index Advisor project.  In this formulation, the index advisor can be
entirely a loadable module instead of requiring a significant part to be
in the core backend, and plans can be generated for hypothetical indexes
without requiring the creation and rolling-back of system catalog entries.

The index advisor patch as-submitted is not compatible with these hooks,
but it needs significant work anyway due to other 8.2-to-8.3 planner
changes.  With these hooks in the core backend, development of the advisor
can proceed as a pgfoundry project.

Revision 1.134: 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
Diff to: previous 1.133: preferred, colored
Changes since revision 1.133: +5 -2 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.133: download - view: text, markup, annotated - select for diffs
Fri Apr 6 22:33:42 2007 UTC (18 years, 5 months ago) by tgl
Branches: MAIN
Diff to: previous 1.132: preferred, colored
Changes since revision 1.132: +2 -1 lines
Make 'col IS NULL' clauses be indexable conditions.

Teodor Sigaev, with some kibitzing from Tom Lane.

Revision 1.132: download - view: text, markup, annotated - select for diffs
Sat Jan 20 23:13:01 2007 UTC (18 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.131: preferred, colored
Changes since revision 1.131: +9 -7 lines
Simplify pg_am representation of ordering-capable access methods:
provide just a boolean 'amcanorder', instead of fields that specify the
sort operator strategy numbers.  We have decided to require ordering-capable
AMs to use btree-compatible strategy numbers, so the old fields are
overkill (and indeed misleading about what's allowed).

Revision 1.131: download - view: text, markup, annotated - select for diffs
Tue Jan 9 02:14:13 2007 UTC (18 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.130: preferred, colored
Changes since revision 1.130: +39 -17 lines
Support ORDER BY ... NULLS FIRST/LAST, and add ASC/DESC/NULLS FIRST/NULLS LAST
per-column options for btree indexes.  The planner's support for this is still
pretty rudimentary; it does not yet know how to plan mergejoins with
nondefault ordering options.  The documentation is pretty rudimentary, too.
I'll work on improving that stuff later.

Note incompatible change from prior behavior: ORDER BY ... USING will now be
rejected if the operator is not a less-than or greater-than member of some
btree opclass.  This prevents less-than-sane behavior if an operator that
doesn't actually define a proper sort ordering is selected.

Revision 1.130: 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.129: preferred, colored
Changes since revision 1.129: +2 -2 lines
Update CVS HEAD for 2007 copyright.  Back branches are typically not
back-stamped for this.

Revision 1.129: download - view: text, markup, annotated - select for diffs
Sat Dec 23 00:43:11 2006 UTC (18 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.128: preferred, colored
Changes since revision 1.128: +4 -4 lines
Restructure operator classes to allow improved handling of cross-data-type
cases.  Operator classes now exist within "operator families".  While most
families are equivalent to a single class, related classes can be grouped
into one family to represent the fact that they are semantically compatible.
Cross-type operators are now naturally adjunct parts of a family, without
having to wedge them into a particular opclass as we had done originally.

This commit restructures the catalogs and cleans up enough of the fallout so
that everything still works at least as well as before, but most of the work
needed to actually improve the planner's behavior will come later.  Also,
there are not yet CREATE/DROP/ALTER OPERATOR FAMILY commands; the only way
to create a new family right now is to allow CREATE OPERATOR CLASS to make
one by default.  I owe some more documentation work, too.  But that can all
be done in smaller pieces once this infrastructure is in place.

Revision 1.128: download - view: text, markup, annotated - select for diffs
Mon Dec 18 18:56:28 2006 UTC (18 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.127: preferred, colored
Changes since revision 1.127: +9 -2 lines
Set pg_am.amstrategies to zero for index AMs that don't have fixed
operator strategy numbers, ie, GiST and GIN.  This is almost cosmetic
enough to not need a catversion bump, but since the opr_sanity regression
test has to change in sync with the catalog entry, I figured I'd better
do one.

Revision 1.127: 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_6, REL8_2_5, 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.126: preferred, colored
Changes since revision 1.126: +16 -16 lines
pgindent run for 8.2.

Revision 1.126: 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.125: preferred, colored
Changes since revision 1.125: +18 -6 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.125: download - view: text, markup, annotated - select for diffs
Fri Aug 25 04:06:50 2006 UTC (19 years ago) by tgl
Branches: MAIN
Diff to: previous 1.124: preferred, colored
Changes since revision 1.124: +13 -1 lines
Add the ability to create indexes 'concurrently', that is, without
blocking concurrent writes to the table.  Greg Stark, with a little help
from Tom Lane.

Revision 1.124: download - view: text, markup, annotated - select for diffs
Sat Aug 5 00:22:49 2006 UTC (19 years, 1 month ago) by tgl
Branches: MAIN
Diff to: previous 1.123: preferred, colored
Changes since revision 1.123: +43 -6 lines
Extend relation_excluded_by_constraints() to check for mutually
contradictory WHERE-clauses applied to a relation.  This makes the
GUC variable constraint_exclusion rather inappropriately named,
but I've refrained for the moment from renaming it.
Per example from Martin Lesser.

Revision 1.123: 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.122: preferred, colored
Changes since revision 1.122: +19 -4 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.122: 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.121: preferred, colored
Changes since revision 1.121: +18 -9 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.121: 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.120: preferred, colored
Changes since revision 1.120: +1 -5 lines
Remove 576 references of include files that were not needed.

Revision 1.120: download - view: text, markup, annotated - select for diffs
Tue Jul 11 17:26:58 2006 UTC (19 years, 2 months ago) by momjian
Branches: MAIN
Diff to: previous 1.119: preferred, colored
Changes since revision 1.119: +3 -3 lines
Alphabetically order reference to include files, "N" - "S".

Revision 1.119: 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.118: preferred, colored
Changes since revision 1.118: +2 -2 lines
Update copyright for 2006.  Update scripts.

Revision 1.118: download - view: text, markup, annotated - select for diffs
Sat Feb 4 23:03:20 2006 UTC (19 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.117: preferred, colored
Changes since revision 1.117: +50 -2 lines
Fix constraint exclusion to work in inherited UPDATE/DELETE queries
... in fact, it will be applied now in any query whatsoever.  I'm still
a bit concerned about the cycles that might be expended in failed proof
attempts, but given that CE is turned off by default, it's the user's
choice whether to expend those cycles or not.  (Possibly we should
change the simple bool constraint_exclusion parameter to something
more fine-grained?)

Revision 1.117: 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.116: preferred, colored
Changes since revision 1.116: +5 -19 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.116: download - view: text, markup, annotated - select for diffs
Thu Jan 5 10:07:45 2006 UTC (19 years, 8 months ago) by petere
Branches: MAIN
Diff to: previous 1.115: preferred, colored
Changes since revision 1.115: +2 -2 lines
Make all command-line options of postmaster and postgres the same.  See
http://archives.postgresql.org/pgsql-hackers/2006-01/msg00151.php for the
complete plan.

Revision 1.114.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_21, REL8_1_20, REL8_1_2, 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, REL8_1_1
Diff to: previous 1.114: preferred, colored; next MAIN 1.115: preferred, colored
Changes since revision 1.114: +10 -10 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.115: download - view: text, markup, annotated - select for diffs
Tue Nov 22 18:17:14 2005 UTC (19 years, 9 months ago) by momjian
Branches: MAIN
Diff to: previous 1.114: preferred, colored
Changes since revision 1.114: +10 -10 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.114: download - view: text, markup, annotated - select for diffs
Sat Oct 15 02:49:21 2005 UTC (19 years, 10 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.113: preferred, colored
Changes since revision 1.113: +66 -66 lines
Standard pgindent run for 8.1.

Revision 1.113: download - view: text, markup, annotated - select for diffs
Sat Jul 23 21:05:47 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.112: preferred, colored
Changes since revision 1.112: +81 -1 lines
Simple constraint exclusion.  For now, only child tables of inheritance
scans are candidates for exclusion; this should be fixed eventually.
Simon Riggs, with some help from Tom Lane.

Revision 1.112: download - view: text, markup, annotated - select for diffs
Mon Jun 13 23:14:48 2005 UTC (20 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.111: preferred, colored
Changes since revision 1.111: +3 -2 lines
Change the planner to allow indexscan qualification clauses to use
nonconsecutive columns of a multicolumn index, as per discussion around
mid-May (pghackers thread "Best way to scan on-disk bitmaps").  This
turns out to require only minimal changes in btree, and so far as I can
see none at all in GiST.  btcostestimate did need some work, but its
original assumption that index selectivity == heap selectivity was
quite bogus even before this.

Revision 1.111: 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.110: preferred, colored
Changes since revision 1.110: +5 -5 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.110: download - view: text, markup, annotated - select for diffs
Sat Jun 4 19:19:42 2005 UTC (20 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.109: preferred, colored
Changes since revision 1.109: +2 -2 lines
Change expandRTE() and ResolveNew() back to taking just the single
RTE of interest, rather than the whole rangetable list.  This makes
the API more understandable and avoids duplicate RTE lookups.  This
patch reverts no-longer-needed portions of my patch of 2004-08-19.

Revision 1.109: download - view: text, markup, annotated - select for diffs
Mon May 30 18:55:49 2005 UTC (20 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.108: preferred, colored
Changes since revision 1.108: +34 -3 lines
Add support for FUNCTION RTEs to build_physical_tlist(), so that the
physical-tlist optimization can be applied to FunctionScan nodes as well
as regular tables and SubqueryScans.

Revision 1.108: 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.107: preferred, colored
Changes since revision 1.107: +25 -6 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.107: download - view: text, markup, annotated - select for diffs
Sun May 22 22:30:20 2005 UTC (20 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.106: preferred, colored
Changes since revision 1.106: +61 -27 lines
Teach the planner to remove SubqueryScan nodes from the plan if they
aren't doing anything useful (ie, neither selection nor projection).
Also, extend to SubqueryScan the hacks already in place to avoid
unnecessary ExecProject calls when the result would just be the same
tuple the subquery already delivered.  This saves some overhead in
UNION and other set operations, as well as avoiding overhead for
unflatten-able subqueries.  Per example from Sokolov Yura.

Revision 1.106: 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.105: preferred, colored
Changes since revision 1.105: +1 -5 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.105: download - view: text, markup, annotated - select for diffs
Thu Apr 14 20:03:24 2005 UTC (20 years, 4 months ago) by tgl
Branches: MAIN
Diff to: previous 1.104: preferred, colored
Changes since revision 1.104: +2 -3 lines
Completion of project to use fixed OIDs for all system catalogs and
indexes.  Replace all heap_openr and index_openr calls by heap_open
and index_open.  Remove runtime lookups of catalog OID numbers in
various places.  Remove relcache's support for looking up system
catalogs by name.  Bulky but mostly very boring patch ...

Revision 1.104: download - view: text, markup, annotated - select for diffs
Wed Apr 6 16:34:06 2005 UTC (20 years, 5 months ago) by tgl
Branches: MAIN
Diff to: previous 1.103: preferred, colored
Changes since revision 1.103: +12 -7 lines
Merge Resdom nodes into TargetEntry nodes to simplify code and save a
few palloc's.  I also chose to eliminate the restype and restypmod fields
entirely, since they are redundant with information stored in the node's
contained expression; re-examining the expression at need seems simpler
and more reliable than trying to keep restype/restypmod up to date.

initdb forced due to change in contents of stored rules.

Revision 1.103: download - view: text, markup, annotated - select for diffs
Tue Mar 29 00:17:02 2005 UTC (20 years, 5 months ago) by tgl
Branches: MAIN
Diff to: previous 1.102: preferred, colored
Changes since revision 1.102: +3 -3 lines
Convert oidvector and int2vector into variable-length arrays.  This
change saves a great deal of space in pg_proc and its primary index,
and it eliminates the former requirement that INDEX_MAX_KEYS and
FUNC_MAX_ARGS have the same value.  INDEX_MAX_KEYS is still embedded
in the on-disk representation (because it affects index tuple header
size), but FUNC_MAX_ARGS is not.  I believe it would now be possible
to increase FUNC_MAX_ARGS at little cost, but haven't experimented yet.
There are still a lot of vestigial references to FUNC_MAX_ARGS, which
I will clean up in a separate pass.  However, getting rid of it
altogether would require changing the FunctionCallInfoData struct,
and I'm not sure I want to buy into that.

Revision 1.102: download - view: text, markup, annotated - select for diffs
Sun Mar 27 06:29:42 2005 UTC (20 years, 5 months ago) by tgl
Branches: MAIN
Diff to: previous 1.101: preferred, colored
Changes since revision 1.101: +2 -1 lines
Add a back-link from IndexOptInfo structs to their parent RelOptInfo
structs.  There are many places in the planner where we were passing
both a rel and an index to subroutines, and now need only pass the
index struct.  Notationally simpler, and perhaps a tad faster.

Revision 1.100.4.1: download - view: text, markup, annotated - select for diffs
Thu Mar 24 19:15:11 2005 UTC (20 years, 5 months ago) by tgl
Branches: REL8_0_STABLE
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_25, REL8_0_24, REL8_0_23, REL8_0_22, REL8_0_21, REL8_0_20, REL8_0_2, REL8_0_19, REL8_0_18, REL8_0_17, REL8_0_16, REL8_0_15, REL8_0_14, REL8_0_13, REL8_0_12, REL8_0_11, REL8_0_10
Diff to: previous 1.100: preferred, colored; next MAIN 1.101: preferred, colored
Changes since revision 1.100: +27 -2 lines
Tweak planner to use a minimum size estimate of 10 pages for a
never-yet-vacuumed relation.  This restores the pre-8.0 behavior of
avoiding seqscans during initial data loading, while still allowing
reasonable optimization after a table has been vacuumed.  Several
regression test cases revert to 7.4-like behavior, which is probably
a good sign.  Per gripes from Keith Browne and others.

Revision 1.101: download - view: text, markup, annotated - select for diffs
Thu Mar 24 19:14:49 2005 UTC (20 years, 5 months ago) by tgl
Branches: MAIN
Diff to: previous 1.100: preferred, colored
Changes since revision 1.100: +27 -2 lines
Tweak planner to use a minimum size estimate of 10 pages for a
never-yet-vacuumed relation.  This restores the pre-8.0 behavior of
avoiding seqscans during initial data loading, while still allowing
reasonable optimization after a table has been vacuumed.  Several
regression test cases revert to 7.4-like behavior, which is probably
a good sign.  Per gripes from Keith Browne and others.

Revision 1.100: 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_1, REL8_0_0RC5, REL8_0_0RC4, REL8_0_0RC3, REL8_0_0
Branch point for: REL8_0_STABLE
Diff to: previous 1.99: preferred, colored
Changes since revision 1.99: +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.99: download - view: text, markup, annotated - select for diffs
Thu Dec 2 01:34:17 2004 UTC (20 years, 9 months ago) by tgl
Branches: MAIN
CVS tags: REL8_0_0RC2, REL8_0_0RC1
Diff to: previous 1.98: preferred, colored
Changes since revision 1.98: +8 -3 lines
Make some adjustments to reduce platform dependencies in plan selection.
In particular, there was a mathematical tie between the two possible
nestloop-with-materialized-inner-scan plans for a join (ie, we computed
the same cost with either input on the inside), resulting in a roundoff
error driven choice, if the relations were both small enough to fit in
sort_mem.  Add a small cost factor to ensure we prefer materializing the
smaller input.  This changes several regression test plans, but with any
luck we will now have more stability across platforms.

Revision 1.98: 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
Diff to: previous 1.97: preferred, colored
Changes since revision 1.97: +141 -6 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.97: download - view: text, markup, annotated - select for diffs
Fri Oct 1 17:11:50 2004 UTC (20 years, 11 months ago) by tgl
Branches: MAIN
CVS tags: REL8_0_0BETA5, REL8_0_0BETA4
Diff to: previous 1.96: preferred, colored
Changes since revision 1.96: +9 -2 lines
Fallout from changing index locking rules: we can reduce the strength
of locking used by REINDEX.  REINDEX needs only ShareLock on the parent
table, same as CREATE INDEX, plus an exclusive lock on the specific index
being processed.

Revision 1.96: 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_0BETA3, REL8_0_0BETA2
Diff to: previous 1.95: preferred, colored
Changes since revision 1.95: +8 -8 lines
Pgindent run for 8.0.

Revision 1.95: 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.94: preferred, colored
Changes since revision 1.94: +2 -2 lines
Update copyright to 2004.

Revision 1.94: download - view: text, markup, annotated - select for diffs
Tue Jun 1 04:47:45 2004 UTC (21 years, 3 months ago) by tgl
Branches: MAIN
CVS tags: REL8_0_0BETA1
Diff to: previous 1.93: preferred, colored
Changes since revision 1.93: +5 -7 lines
Just about there on de-FastList-ification.

Revision 1.93: 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.92: preferred, colored
Changes since revision 1.92: +4 -4 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.92: 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.91: preferred, colored
Changes since revision 1.91: +6 -6 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.91: download - view: text, markup, annotated - select for diffs
Sun Jan 4 00:07:32 2004 UTC (21 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.90: preferred, colored
Changes since revision 1.90: +2 -1 lines
Rewrite OR indexscan processing to be more flexible.  We can now for the
first time generate an OR indexscan for a two-column index when the WHERE
condition is like 'col1 = foo AND (col2 = bar OR col2 = baz)' --- before,
the OR had to be on the first column of the index or we'd not notice the
possibility of using it.  Some progress towards extracting OR indexscans
from subclauses of an OR that references multiple relations, too, although
this code is #ifdef'd out because it needs more work.

Revision 1.90: 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.89: preferred, colored
Changes since revision 1.89: +1 -1 lines

$Header: -> $PostgreSQL Changes ...

Revision 1.89: download - view: text, markup, annotated - select for diffs
Wed Nov 12 21:15:54 2003 UTC (21 years, 10 months ago) by tgl
Branches: MAIN
Diff to: previous 1.88: preferred, colored
Changes since revision 1.88: +5 -6 lines
Cross-data-type comparisons are now indexable by btrees, pursuant to my
pghackers proposal of 8-Nov.  All the existing cross-type comparison
operators (int2/int4/int8 and float4/float8) have appropriate support.
The original proposal of storing the right-hand-side datatype as part of
the primary key for pg_amop and pg_amproc got modified a bit in the event;
it is easier to store zero as the 'default' case and only store a nonzero
when the operator is actually cross-type.  Along the way, remove the
long-since-defunct bigbox_ops operator class.

Revision 1.88: download - view: text, markup, annotated - select for diffs
Sun Nov 9 21:30:37 2003 UTC (21 years, 10 months ago) by tgl
Branches: MAIN
Diff to: previous 1.87: preferred, colored
Changes since revision 1.87: +6 -6 lines
Add operator strategy and comparison-value datatype fields to ScanKey.
Remove the 'strategy map' code, which was a large amount of mechanism
that no longer had any use except reverse-mapping from procedure OID to
strategy number.  Passing the strategy number to the index AM in the
first place is simpler and faster.
This is a preliminary step in planned support for cross-datatype index
operations.  I'm committing it now since the ScanKeyEntryInitialize()
API change touches quite a lot of files, and I want to commit those
changes before the tree drifts under me.

Revision 1.87: 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_STABLE, REL7_4_RC2, REL7_4_RC1, REL7_4_BETA5, REL7_4_BETA4, REL7_4_BETA3, REL7_4_BETA2, REL7_4_BETA1, REL7_4_9, REL7_4_8, REL7_4_7, REL7_4_6, REL7_4_5, REL7_4_4, REL7_4_3, 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_2, REL7_4_19, REL7_4_18, 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, REL7_4
Diff to: previous 1.86: preferred, colored
Changes since revision 1.86: +2 -2 lines
Update copyrights to 2003.

Revision 1.86: 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.85: preferred, colored
Changes since revision 1.85: +15 -13 lines
pgindent run.

Revision 1.85: 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.84: preferred, colored
Changes since revision 1.84: +4 -4 lines
Error message editing in backend/optimizer, backend/rewrite.

Revision 1.84: 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.83: preferred, colored
Changes since revision 1.83: +66 -39 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.83: download - view: text, markup, annotated - select for diffs
Wed May 28 16:03:56 2003 UTC (22 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.82: preferred, colored
Changes since revision 1.82: +35 -45 lines
Replace functional-index facility with expressional indexes.  Any column
of an index can now be a computed expression instead of a simple variable.
Restrictions on expressions are the same as for predicates (only immutable
functions, no sub-selects).  This fixes problems recently introduced with
inlining SQL functions, because the inlining transformation is applied to
both expression trees so the planner can still match them up.  Along the
way, improve efficiency of handling index predicates (both predicates and
index expressions are now cached by the relcache) and fix 7.3 oversight
that didn't record dependencies of predicate expressions.

Revision 1.82: download - view: text, markup, annotated - select for diffs
Mon May 12 00:17:03 2003 UTC (22 years, 4 months ago) by tgl
Branches: MAIN
Diff to: previous 1.81: preferred, colored
Changes since revision 1.81: +17 -3 lines
Apply fixes for problems with dropped columns whose types have also been
dropped.  The simplest fix for INSERT/UPDATE cases turns out to be for
preptlist.c to insert NULLs of a known-good type (I used INT4) rather
than making them match the deleted column's type.  Since the representation
of NULL is actually datatype-independent, this should work fine.
I also re-reverted the patch to disable the use_physical_tlist optimization
in the presence of dropped columns.  It still doesn't look worth the
trouble to be smarter, if there are no other bugs to fix.
Added a regression test to catch future problems in this area.

Revision 1.81: download - view: text, markup, annotated - select for diffs
Sun May 11 20:25:50 2003 UTC (22 years, 4 months ago) by tgl
Branches: MAIN
Diff to: previous 1.80: preferred, colored
Changes since revision 1.80: +2 -16 lines
Revert previous change --- turns out the underlying problem affects
more cases than I thought, so ExecTypeFromTL() will have to be fixed
anyway.

Revision 1.80: download - view: text, markup, annotated - select for diffs
Sun May 11 15:03:52 2003 UTC (22 years, 4 months ago) by tgl
Branches: MAIN
Diff to: previous 1.79: preferred, colored
Changes since revision 1.79: +17 -3 lines
Disable the recently-added use_physical_tlist optimization in cases
where the table contains dropped columns.  If the columns are dropped,
then their types may be gone as well, which causes ExecTypeFromTL() to
fail if the dropped columns appear in a plan node's tlist.  This could
be worked around but I don't think the optimization is valuable enough
to be worth the trouble.

Revision 1.79: download - view: text, markup, annotated - select for diffs
Sun Feb 9 06:56:27 2003 UTC (22 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.78: preferred, colored
Changes since revision 1.78: +4 -4 lines
Create a distinction between Lists of integers and Lists of OIDs, to get
rid of the assumption that sizeof(Oid)==sizeof(int).  This is one small
step towards someday supporting 8-byte OIDs.  For the moment, it doesn't
do much except get rid of a lot of unsightly casts.

Revision 1.78: 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.77: preferred, colored
Changes since revision 1.77: +3 -3 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.77: 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.76: preferred, colored
Changes since revision 1.76: +127 -121 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.76: download - view: text, markup, annotated - select for diffs
Tue Jan 28 22:13:35 2003 UTC (22 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.75: preferred, colored
Changes since revision 1.75: +7 -6 lines
Extend join-selectivity API (oprjoin interface) so that join type is
passed to join selectivity estimators.  Make use of this in eqjoinsel
to derive non-bogus selectivity for IN clauses.  Further tweaking of
cost estimation for IN.
initdb forced because of pg_proc.h changes.

Revision 1.75: 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.74: preferred, colored
Changes since revision 1.74: +5 -1 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.74: download - view: text, markup, annotated - select for diffs
Wed Sep 4 20:31:22 2002 UTC (23 years ago) by momjian
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.73: preferred, colored
Changes since revision 1.73: +2 -2 lines
pgindent run.

Revision 1.73: 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.72: preferred, colored
Changes since revision 1.72: +2 -2 lines
Update copyright to 2002.

Revision 1.72: download - view: text, markup, annotated - select for diffs
Mon May 20 23:51:42 2002 UTC (23 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.71: preferred, colored
Changes since revision 1.71: +3 -3 lines
Restructure indexscan API (index_beginscan, index_getnext) per
yesterday's proposal to pghackers.  Also remove unnecessary parameters
to heap_beginscan, heap_rescan.  I modified pg_proc.h to reflect the
new numbers of parameters for the AM interface routines, but did not
force an initdb because nothing actually looks at those fields.

Revision 1.71: download - view: text, markup, annotated - select for diffs
Fri Apr 12 20:38:26 2002 UTC (23 years, 5 months ago) by tgl
Branches: MAIN
Diff to: previous 1.70: preferred, colored
Changes since revision 1.70: +2 -3 lines
Checking to decide whether relations are system relations now depends
on the namespace not the name; pg_ is not a reserved prefix for table
names anymore.  From Fernando Nasser.

Revision 1.70: download - view: text, markup, annotated - select for diffs
Tue Feb 19 20:11:14 2002 UTC (23 years, 6 months ago) by tgl
Branches: MAIN
Diff to: previous 1.69: preferred, colored
Changes since revision 1.69: +11 -28 lines
A bunch of changes aimed at reducing backend startup time...

Improve 'pg_internal.init' relcache entry preload mechanism so that it is
safe to use for all system catalogs, and arrange to preload a realistic
set of system-catalog entries instead of only the three nailed-in-cache
indexes that were formerly loaded this way.  Fix mechanism for deleting
out-of-date pg_internal.init files: this must be synchronized with transaction
commit, not just done at random times within transactions.  Drive it off
relcache invalidation mechanism so that no special-case tests are needed.

Cache additional information in relcache entries for indexes (their pg_index
tuples and index-operator OIDs) to eliminate repeated lookups.  Also cache
index opclass info at the per-opclass level to avoid repeated lookups during
relcache load.

Generalize 'systable scan' utilities originally developed by Hiroshi,
move them into genam.c, use in a number of places where there was formerly
ugly code for choosing either heap or index scan.  In particular this allows
simplification of the logic that prevents infinite recursion between syscache
and relcache during startup: we can easily switch to heapscans in relcache.c
when and where needed to avoid recursion, so IndexScanOK becomes simpler and
does not need any expensive initialization.

Eliminate useless opening of a heapscan data structure while doing an indexscan
(this saves an mdnblocks call and thus at least one kernel call).

Revision 1.69: 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.68: preferred, colored
Changes since revision 1.68: +13 -13 lines
pgindent run on all C files.  Java run to follow.  initdb/regression
tests pass.

Revision 1.68: download - view: text, markup, annotated - select for diffs
Tue Aug 21 16:36:03 2001 UTC (24 years ago) by tgl
Branches: MAIN
Diff to: previous 1.67: preferred, colored
Changes since revision 1.67: +9 -15 lines
Restructure pg_opclass, pg_amop, and pg_amproc per previous discussions in
pgsql-hackers.  pg_opclass now has a row for each opclass supported by each
index AM, not a row for each opclass name.  This allows pg_opclass to show
directly whether an AM supports an opclass, and furthermore makes it possible
to store additional information about an opclass that might be AM-dependent.
pg_opclass and pg_amop now store "lossy" and "haskeytype" information that we
previously expected the user to remember to provide in CREATE INDEX commands.
Lossiness is no longer an index-level property, but is associated with the
use of a particular operator in a particular index opclass.

Along the way, IndexSupportInitialize now uses the syscaches to retrieve
pg_amop and pg_amproc entries.  I find this reduces backend launch time by
about ten percent, at the cost of a couple more special cases in catcache.c's
IndexScanOK.

Initial work by Oleg Bartunov and Teodor Sigaev, further hacking by Tom Lane.

initdb forced.

Revision 1.67: download - view: text, markup, annotated - select for diffs
Sun Jul 15 22:48:18 2001 UTC (24 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.66: preferred, colored
Changes since revision 1.66: +2 -2 lines
Restructure index AM interface for index building and index tuple deletion,
per previous discussion on pghackers.  Most of the duplicate code in
different AMs' ambuild routines has been moved out to a common routine
in index.c; this means that all index types now do the right things about
inserting recently-dead tuples, etc.  (I also removed support for EXTEND
INDEX in the ambuild routines, since that's about to go away anyway, and
it cluttered the code a lot.)  The retail indextuple deletion routines have
been replaced by a "bulk delete" routine in which the indexscan is inside
the access method.  I haven't pushed this change as far as it should go yet,
but it should allow considerable simplification of the internal bookkeeping
for deletions.  Also, add flag columns to pg_am to eliminate various
hardcoded tests on AM OIDs, and remove unused pg_am columns.

Fix rtree and gist index types to not attempt to store NULLs; before this,
gist usually crashed, while rtree managed not to crash but computed wacko
bounding boxes for NULL entries (which might have had something to do with
the performance problems we've heard about occasionally).

Add AtEOXact routines to hash, rtree, and gist, all of which have static
state that needs to be reset after an error.  We discovered this need long
ago for btree, but missed the other guys.

Oh, one more thing: concurrent VACUUM is now the default.

Revision 1.66: 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.65: preferred, colored
Changes since revision 1.65: +103 -48 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.65: download - view: text, markup, annotated - select for diffs
Mon May 7 00:43:22 2001 UTC (24 years, 4 months ago) by tgl
Branches: MAIN
Diff to: previous 1.64: preferred, colored
Changes since revision 1.64: +1 -2 lines
Rewrite of planner statistics-gathering code.  ANALYZE is now available as
a separate statement (though it can still be invoked as part of VACUUM, too).
pg_statistic redesigned to be more flexible about what statistics are
stored.  ANALYZE now collects a list of several of the most common values,
not just one, plus a histogram (not just the min and max values).  Random
sampling is used to make the process reasonably fast even on very large
tables.  The number of values and histogram bins collected is now
user-settable via an ALTER TABLE command.

There is more still to do; the new stats are not being used everywhere
they could be in the planner.  But the remaining changes for this project
should be localized, and the behavior is already better than before.

A not-very-related change is that sorting now makes use of btree comparison
routines if it can find one, rather than invoking '<' twice.

Revision 1.64: download - view: text, markup, annotated - select for diffs
Thu Mar 22 03:59:40 2001 UTC (24 years, 5 months ago) by momjian
Branches: MAIN
CVS tags: REL7_1_STABLE, REL7_1_2, REL7_1
Diff to: previous 1.63: preferred, colored
Changes since revision 1.63: +19 -19 lines
pgindent run.  Make it all clean.

Revision 1.63: 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.62: preferred, colored
Changes since revision 1.62: +2 -2 lines
Change Copyright from PostgreSQL, Inc to PostgreSQL Global Development Group.

Revision 1.62: download - view: text, markup, annotated - select for diffs
Thu Nov 16 22:30:26 2000 UTC (24 years, 9 months ago) by tgl
Branches: MAIN
CVS tags: REL7_1_BETA3, REL7_1_BETA2, REL7_1_BETA
Diff to: previous 1.61: preferred, colored
Changes since revision 1.61: +27 -21 lines
Change SearchSysCache coding conventions so that a reference count is
maintained for each cache entry.  A cache entry will not be freed until
the matching ReleaseSysCache call has been executed.  This eliminates
worries about cache entries getting dropped while still in use.  See
my posting to pg-hackers of even date for more info.

Revision 1.61: 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.60: preferred, colored
Changes since revision 1.60: +8 -11 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.60: download - view: text, markup, annotated - select for diffs
Thu Jul 27 23:16:04 2000 UTC (25 years, 1 month ago) by tgl
Branches: MAIN
Diff to: previous 1.59: preferred, colored
Changes since revision 1.59: +7 -51 lines
Make planner safe for recursive calls --- needed for cases where
eval_const_expressions tries to simplify an SQL function.

Revision 1.59: download - view: text, markup, annotated - select for diffs
Wed Jul 5 23:11:26 2000 UTC (25 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.58: preferred, colored
Changes since revision 1.58: +4 -2 lines
Update textin() and textout() to new fmgr style.  This is just phase
one of updating the whole text datatype, but there are so dang many
calls of these two routines that it seems worth a separate commit.

Revision 1.58: download - view: text, markup, annotated - select for diffs
Tue Jun 20 04:22:14 2000 UTC (25 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.57: preferred, colored
Changes since revision 1.57: +22 -8 lines
Make inheritance planning logic a little simpler and clearer,
hopefully even a little faster.

Revision 1.57: download - view: text, markup, annotated - select for diffs
Sat Jun 17 21:48:51 2000 UTC (25 years, 2 months ago) by tgl
Branches: MAIN
Diff to: previous 1.56: preferred, colored
Changes since revision 1.56: +34 -26 lines
Fix performance problems with pg_index lookups (see, for example,
discussion of 5/19/00).  pg_index is now searched for indexes of a
relation using an indexscan.  Moreover, this is done once and cached
in the relcache entry for the relation, in the form of a list of OIDs
for the indexes.  This list is used by the parser and executor to drive
lookups in the pg_index syscache when they want to know the properties
of the indexes.  Net result: index information will be fully cached
for repetitive operations such as inserts.

Revision 1.56: download - view: text, markup, annotated - select for diffs
Thu Jun 15 03:32:16 2000 UTC (25 years, 3 months ago) by momjian
Branches: MAIN
Diff to: previous 1.55: preferred, colored
Changes since revision 1.55: +3 -2 lines
Clean up #include's.

Revision 1.55: download - view: text, markup, annotated - select for diffs
Fri Jun 9 03:17:12 2000 UTC (25 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.54: preferred, colored
Changes since revision 1.54: +13 -8 lines
Cause inheritance patch to meet minimum coding standards (no gcc
warnings).

Revision 1.54: download - view: text, markup, annotated - select for diffs
Fri Jun 9 01:44:16 2000 UTC (25 years, 3 months ago) by momjian
Branches: MAIN
Diff to: previous 1.53: preferred, colored
Changes since revision 1.53: +24 -1 lines
Inheritance overhaul by  Chris Bitmead <chris@bitmead.com>

Revision 1.53: download - view: text, markup, annotated - select for diffs
Tue May 30 04:24:48 2000 UTC (25 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.52: preferred, colored
Changes since revision 1.52: +20 -26 lines
Third round of fmgr updates: eliminate calls using fmgr() and
fmgr_faddr() in favor of new-style calls.  Lots of cleanup of
sloppy casts to use XXXGetDatum and DatumGetXXX ...

Revision 1.52: download - view: text, markup, annotated - select for diffs
Tue May 30 00:49:49 2000 UTC (25 years, 3 months ago) by momjian
Branches: MAIN
Diff to: previous 1.51: preferred, colored
Changes since revision 1.51: +1 -4 lines
Remove unused include files.  Do not touch /port or includes used by defines.

Revision 1.51: download - view: text, markup, annotated - select for diffs
Sun May 28 17:55:59 2000 UTC (25 years, 3 months ago) by tgl
Branches: MAIN
Diff to: previous 1.50: preferred, colored
Changes since revision 1.50: +4 -2 lines
First round of changes for new fmgr interface.  fmgr itself and the
key call sites are changed, but most called functions are still oldstyle.
An exception is that the PL managers are updated (so, for example, NULL
handling now behaves as expected in plperl and plpgsql functions).
NOTE initdb is forced due to added column in pg_proc.

Revision 1.50: 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.49: preferred, colored
Changes since revision 1.49: +21 -21 lines
Ye-old pgindent run.  Same 4-space tabs.

Revision 1.49: download - view: text, markup, annotated - select for diffs
Fri Feb 18 09:30:09 2000 UTC (25 years, 6 months ago) by inoue
Branches: MAIN
Diff to: previous 1.48: preferred, colored
Changes since revision 1.48: +7 -2 lines
Implement reindex command

Revision 1.48: download - view: text, markup, annotated - select for diffs
Thu Feb 17 03:39:40 2000 UTC (25 years, 6 months ago) by tgl
Branches: MAIN
Diff to: previous 1.47: preferred, colored
Changes since revision 1.47: +19 -18 lines
Finish repairing 6.5's problems with r-tree indexes: create appropriate
selectivity functions and make the r-tree operators use them.  The
estimation functions themselves are just stubs, unfortunately, but
perhaps someday someone will make them compute realistic estimates.
Change pg_am so that the optimizer can reliably tell the difference
between ordered and unordered indexes --- before it would think that
an r-tree index can be scanned in '<<' order, which is not right AFAIK.
Repair broken negator links for network_sup and related ops.
Initdb forced.  This might be my last initdb force for 7.0 ... hope so
anyway ...

Revision 1.47: download - view: text, markup, annotated - select for diffs
Tue Feb 15 20:49:20 2000 UTC (25 years, 6 months ago) by tgl
Branches: MAIN
Diff to: previous 1.46: preferred, colored
Changes since revision 1.46: +2 -1 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.46: 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.45: preferred, colored
Changes since revision 1.45: +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.45: download - view: text, markup, annotated - select for diffs
Sat Jan 22 23:50:17 2000 UTC (25 years, 7 months ago) by tgl
Branches: MAIN
Diff to: previous 1.44: preferred, colored
Changes since revision 1.44: +2 -211 lines
Revise handling of index-type-specific indexscan cost estimation, per
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).

Revision 1.44: download - view: text, markup, annotated - select for diffs
Sat Jan 15 02:59:31 2000 UTC (25 years, 8 months ago) by petere
Branches: MAIN
Diff to: previous 1.43: preferred, colored
Changes since revision 1.43: +3 -3 lines
Fixed all elog related warnings, as well as a few others.

Revision 1.43: download - view: text, markup, annotated - select for diffs
Wed Jan 12 00:53:21 2000 UTC (25 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.42: preferred, colored
Changes since revision 1.42: +3 -1 lines
Put back erroneously removed zeroing of sentinel elements
in indexkeys, classlist arrays.

Revision 1.42: download - view: text, markup, annotated - select for diffs
Tue Jan 11 03:33:13 2000 UTC (25 years, 8 months ago) by momjian
Branches: MAIN
Diff to: previous 1.41: preferred, colored
Changes since revision 1.41: +1 -3 lines
More cleanups.  Still doesn't work.

Revision 1.41: download - view: text, markup, annotated - select for diffs
Sun Jan 9 00:26:40 2000 UTC (25 years, 8 months ago) by tgl
Branches: MAIN
Diff to: previous 1.40: preferred, colored
Changes since revision 1.40: +206 -269 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.40: download - view: text, markup, annotated - select for diffs
Mon Nov 22 17:56:17 1999 UTC (25 years, 9 months ago) by momjian
Branches: MAIN
Diff to: previous 1.39: preferred, colored
Changes since revision 1.39: +2 -2 lines
Add system indexes to match all caches.
Make all system indexes unique.
Make all cache loads use system indexes.
Rename *rel to *relid in inheritance tables.
Rename cache names to be clearer.

Revision 1.39: download - view: text, markup, annotated - select for diffs
Sun Nov 21 23:25:47 1999 UTC (25 years, 9 months ago) by tgl
Branches: MAIN
Diff to: previous 1.38: preferred, colored
Changes since revision 1.38: +108 -132 lines
Combine index_info and find_secondary_indexes into a single routine that
returns a list of RelOptInfos, eliminating the need for static state
in index_info.  That static state was a direct cause of coredumps; if
anything decided to elog(ERROR) partway through an index_info search of
pg_index, the next query would try to close a scan pointer that was
pointing at no-longer-valid memory.  Another example of the reasons to
avoid static state variables...

Revision 1.38: download - view: text, markup, annotated - select for diffs
Sat Sep 18 19:07:06 1999 UTC (25 years, 11 months ago) by tgl
Branches: MAIN
Diff to: previous 1.37: preferred, colored
Changes since revision 1.37: +12 -10 lines
Mega-commit to make heap_open/heap_openr/heap_close take an
additional argument specifying the kind of lock to acquire/release (or
'NoLock' to do no lock processing).  Ensure that all relations are locked
with some appropriate lock level before being examined --- this ensures
that relevant shared-inval messages have been processed and should prevent
problems caused by concurrent VACUUM.  Fix several bugs having to do with
mismatched increment/decrement of relation ref count and mismatched
heap_open/close (which amounts to the same thing).  A bogus ref count on
a relation doesn't matter much *unless* a SI Inval message happens to
arrive at the wrong time, which is probably why we got away with this
sloppiness for so long.  Repair missing grab of AccessExclusiveLock in
DROP TABLE, ALTER/RENAME TABLE, etc, as noted by Hiroshi.
Recommend 'make clean all' after pulling this update; I modified the
Relation struct layout slightly.
Will post further discussion to pghackers list shortly.

Revision 1.37: download - view: text, markup, annotated - select for diffs
Thu Sep 9 02:35:53 1999 UTC (26 years ago) by tgl
Branches: MAIN
Diff to: previous 1.36: preferred, colored
Changes since revision 1.36: +4 -4 lines
Repair error noticed by Roberto Cornacchia: selectivity code
was rejecting negative attnums as bogus, which of course they are not.
Add code to get_attdisbursion to produce a useful value for OID attribute,
since VACUUM does not store stats for system attributes.
Also, repair bug that's been in eqjoinsel for a long time: it was taking
the max of the two columns' disbursions, whereas it should use the min.

Revision 1.36: download - view: text, markup, annotated - select for diffs
Sun Jul 25 23:07:26 1999 UTC (26 years, 1 month ago) by tgl
Branches: MAIN
Diff to: previous 1.35: preferred, colored
Changes since revision 1.35: +85 -102 lines
Further work on planning of indexscans.  Cleaned up interfaces
to index_selectivity so that it can be handed an indexqual clause list
rather than a bunch of assorted derivative data.

Revision 1.35: download - view: text, markup, annotated - select for diffs
Sat Jul 17 20:17:18 1999 UTC (26 years, 1 month ago) by momjian
Branches: MAIN
Diff to: previous 1.34: preferred, colored
Changes since revision 1.34: +2 -12 lines
 Move some system includes into c.h, and remove duplicates.

Revision 1.34: download - view: text, markup, annotated - select for diffs
Fri Jul 16 04:59:26 1999 UTC (26 years, 2 months ago) by momjian
Branches: MAIN
Diff to: previous 1.33: preferred, colored
Changes since revision 1.33: +7 -6 lines
Final cleanup.

Revision 1.33: 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.32: preferred, colored
Changes since revision 1.32: +2 -2 lines
Update #include cleanups

Revision 1.32: 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.31: preferred, colored
Changes since revision 1.31: +1 -7 lines
Remove unused #includes in *.c files.

Revision 1.31: download - view: text, markup, annotated - select for diffs
Wed Jul 7 16:09:33 1999 UTC (26 years, 2 months ago) by momjian
Branches: MAIN
CVS tags: REL6_5_PATCHES, REL6_5
Diff to: previous 1.30: preferred, colored
Changes since revision 1.30: +2 -1 lines
Fix for \do and ceil()/float.

Revision 1.30: download - view: text, markup, annotated - select for diffs
Tue May 25 16:09:59 1999 UTC (26 years, 3 months ago) by momjian
Branches: MAIN
Diff to: previous 1.29: preferred, colored
Changes since revision 1.29: +4 -2 lines
pgindent run over code.

Revision 1.29: download - view: text, markup, annotated - select for diffs
Mon May 10 00:45:25 1999 UTC (26 years, 4 months ago) by momjian
Branches: MAIN
Diff to: previous 1.28: preferred, colored
Changes since revision 1.28: +7 -7 lines
Change error messages to oids come out as %u and not %d.  Change has no
real affect now.

Revision 1.28: download - view: text, markup, annotated - select for diffs
Thu Mar 18 19:59:54 1999 UTC (26 years, 5 months ago) by momjian
Branches: MAIN
Diff to: previous 1.27: preferred, colored
Changes since revision 1.27: +2 -2 lines
cleanups

Revision 1.27: download - view: text, markup, annotated - select for diffs
Mon Mar 8 14:01:57 1999 UTC (26 years, 6 months ago) by momjian
Branches: MAIN
Diff to: previous 1.26: preferred, colored
Changes since revision 1.26: +1 -2 lines
Fix OR index selectivity problem.

Revision 1.26: download - view: text, markup, annotated - select for diffs
Sun Feb 21 03:48:54 1999 UTC (26 years, 6 months ago) by scrappy
Branches: MAIN
Diff to: previous 1.25: preferred, colored
Changes since revision 1.25: +2 -2 lines

From: Tatsuo Ishii <t-ishii@sra.co.jp>

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.

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

Revision 1.24: download - view: text, markup, annotated - select for diffs
Wed Feb 3 21:16:52 1999 UTC (26 years, 7 months ago) by momjian
Branches: MAIN
Diff to: previous 1.23: preferred, colored
Changes since revision 1.23: +2 -3 lines
Cleanup of source files where 'return' or 'var =' is alone on a line.

Revision 1.23: download - view: text, markup, annotated - select for diffs
Thu Oct 8 18:29:30 1998 UTC (26 years, 11 months ago) by momjian
Branches: MAIN
CVS tags: REL6_4
Diff to: previous 1.22: preferred, colored
Changes since revision 1.22: +4 -1 lines
Make functions static or ifdef NOT_USED.  Prevent pg_version creation.

Revision 1.22: download - view: text, markup, annotated - select for diffs
Wed Sep 23 04:22:10 1998 UTC (26 years, 11 months ago) by momjian
Branches: MAIN
Diff to: previous 1.21: preferred, colored
Changes since revision 1.21: +3 -3 lines
Allow 8-key indexes.

Revision 1.21: download - view: text, markup, annotated - select for diffs
Tue Sep 1 04:30:09 1998 UTC (27 years ago) by momjian
Branches: MAIN
Diff to: previous 1.20: preferred, colored
Changes since revision 1.20: +6 -7 lines
OK, folks, here is the pgindent output.

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

Revision 1.19: download - view: text, markup, annotated - select for diffs
Wed Aug 19 02:02:16 1998 UTC (27 years ago) by momjian
Branches: MAIN
Diff to: previous 1.18: preferred, colored
Changes since revision 1.18: +5 -11 lines
heap_fetch requires buffer pointer, must be released; heap_getnext
no longer returns buffer pointer, can be gotten from scan;
	descriptor; bootstrap can create multi-key indexes;
pg_procname index now is multi-key index; oidint2, oidint4, oidname
are gone (must be removed from regression tests); use System Cache
rather than sequential scan in many places; heap_modifytuple no
longer takes buffer parameter; remove unused buffer parameter in
a few other functions; oid8 is not index-able; remove some use of
single-character variable names; cleanup Buffer variables usage
and scan descriptor looping; cleaned up allocation and freeing of
tuples; 18k lines of diff;

Revision 1.18: download - view: text, markup, annotated - select for diffs
Mon Jul 27 19:38:00 1998 UTC (27 years, 1 month ago) by vadim
Branches: MAIN
Diff to: previous 1.17: preferred, colored
Changes since revision 1.17: +4 -4 lines
Use Snapshot in heap access methods.

Revision 1.17: download - view: text, markup, annotated - select for diffs
Mon Jun 15 19:28:49 1998 UTC (27 years, 3 months ago) by momjian
Branches: MAIN
Diff to: previous 1.16: preferred, colored
Changes since revision 1.16: +1 -9 lines
Remove un-needed braces around single statements.

Revision 1.16: 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.15: preferred, colored
Changes since revision 1.15: +3 -3 lines
pgindent run before 6.3 release, with Thomas' requested changes.

Revision 1.15: download - view: text, markup, annotated - select for diffs
Wed Feb 11 19:10:47 1998 UTC (27 years, 7 months ago) by momjian
Branches: MAIN
Diff to: previous 1.14: preferred, colored
Changes since revision 1.14: +3 -3 lines
Goodbye register keyword.  Compiler knows better.

Revision 1.14: download - view: text, markup, annotated - select for diffs
Thu Jan 15 19:44:41 1998 UTC (27 years, 7 months ago) by pgsql
Branches: MAIN
Diff to: previous 1.13: preferred, colored
Changes since revision 1.13: +5 -3 lines
Thank god for searchable mail archives.

Patch by: wieck@sapserv.debis.de (Jan Wieck)

   One  of  the design rules of PostgreSQL is extensibility. And
   to follow this rule means (at least for me) that there should
   not  only  be a builtin PL.  Instead I would prefer a defined
   interface for PL implemetations.

Revision 1.13: download - view: text, markup, annotated - select for diffs
Wed Jan 7 21:04:17 1998 UTC (27 years, 8 months ago) by momjian
Branches: MAIN
Diff to: previous 1.12: preferred, colored
Changes since revision 1.12: +11 -11 lines
Goodbye ABORT.  Hello ERROR for all errors.

Revision 1.12: download - view: text, markup, annotated - select for diffs
Mon Jan 5 03:32:09 1998 UTC (27 years, 8 months ago) by momjian
Branches: MAIN
Diff to: previous 1.11: preferred, colored
Changes since revision 1.11: +11 -11 lines
Change elog(WARN) to elog(ERROR) and elog(ABORT).

Revision 1.11: download - view: text, markup, annotated - select for diffs
Thu Nov 20 23:22:01 1997 UTC (27 years, 9 months ago) by momjian
Branches: MAIN
Diff to: previous 1.10: preferred, colored
Changes since revision 1.10: +4 -4 lines
Remove all time travel stuff.  Small parser cleanup.

Revision 1.10: download - view: text, markup, annotated - select for diffs
Thu Sep 18 20:20:50 1997 UTC (27 years, 11 months ago) by momjian
Branches: MAIN
Diff to: previous 1.9: preferred, colored
Changes since revision 1.9: +5 -5 lines
Inline memset() as MemSet().

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

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

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

Revision 1.6: download - view: text, markup, annotated - select for diffs
Thu Apr 24 16:07:14 1997 UTC (28 years, 4 months ago) by vadim
Branches: MAIN
Diff to: previous 1.5: preferred, colored
Changes since revision 1.5: +34 -7 lines
     * Hack for non-functional btree npages estimation:
     * npages = index_pages * selectivity_of_1st_attr_clause(s)

Revision 1.5: download - view: text, markup, annotated - select for diffs
Wed Apr 9 01:52:04 1997 UTC (28 years, 5 months ago) by vadim
Branches: MAIN
Diff to: previous 1.4: preferred, colored
Changes since revision 1.4: +16 -2 lines
Fix (hack) IndexSelectivity():
use sum(npages)/((nkeys == 1) ? 1 : nkeys + 1) as expected index page
estimation for multi-key quals - instead of sum(npages).
In old code npages for x > 10 and x < 20 is twice as for x > 10 - cool ?

Revision 1.4: download - view: text, markup, annotated - select for diffs
Wed Mar 12 21:06:14 1997 UTC (28 years, 6 months ago) by scrappy
Branches: MAIN
Diff to: previous 1.3: preferred, colored
Changes since revision 1.3: +4 -4 lines
From: Dan McGuirk <mcguirk@indirect.com>
Subject: [HACKERS] linux/alpha patches

These patches lay the groundwork for a Linux/Alpha port.  The port doesn't
actually work unless you tweak the linker to put all the pointers in the
first 32 bits of the address space, but it's at least a start.  It
implements the test-and-set instruction in Alpha assembly, and also fixes
a lot of pointer-to-integer conversions, which is probably good anyway.

Revision 1.3: download - view: text, markup, annotated - select for diffs
Wed Nov 6 09:29:24 1996 UTC (28 years, 10 months ago) by scrappy
Branches: MAIN
CVS tags: REL2_0B, REL2_0
Diff to: previous 1.2: preferred, colored
Changes since revision 1.2: +6 -5 lines
More files cleaned out

Revision 1.2: download - view: text, markup, annotated - select for diffs
Wed Jul 31 18:47:08 1996 UTC (29 years, 1 month ago) by scrappy
Branches: MAIN
CVS tags: Release_2_0_0, Release_2_0, Release_1_0_3, Release_1_0_2
Diff to: previous 1.1: preferred, colored
Changes since revision 1.1: +4 -4 lines
This prevent gcc from complaining about casting a short to a char * and
fixes another complaint.

More fixes from Bruce...

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: 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>