postgresql/src/test/regress/sql
Tom Lane 6a6522529f Fix some planner issues found while investigating Kevin Grittner's report
of poorer planning in 8.3 than 8.2:

1. After pushing a constant across an outer join --- ie, given
"a LEFT JOIN b ON (a.x = b.y) WHERE a.x = 42", we can deduce that b.y is
sort of equal to 42, in the sense that we needn't fetch any b rows where
it isn't 42 --- loop to see if any additional deductions can be made.
Previous releases did that by recursing, but I had mistakenly thought that
this was no longer necessary given the EquivalenceClass machinery.

2. Allow pushing constants across outer join conditions even if the
condition is outerjoin_delayed due to a lower outer join.  This is safe
as long as the condition is strict and we re-test it at the upper join.

3. Keep the outer-join clause even if we successfully push a constant
across it.  This is *necessary* in the outerjoin_delayed case, but
even in the simple case, it seems better to do this to ensure that the
join search order heuristics will consider the join as reasonable to
make.  Mark such a clause as having selectivity 1.0, though, since it's
not going to eliminate very many rows after application of the constant
condition.

4. Tweak have_relevant_eclass_joinclause to report that two relations
are joinable when they have vars that are equated to the same constant.
We won't actually generate any joinclause from such an EquivalenceClass,
but again it seems that in such a case it's a good idea to consider
the join as worth costing out.

5. Fix a bug in select_mergejoin_clauses that was exposed by these
changes: we have to reject candidate mergejoin clauses if either side was
equated to a constant, because we can't construct a canonical pathkey list
for such a clause.  This is an implementation restriction that might be
worth fixing someday, but it doesn't seem critical to get it done for 8.3.
2008-01-09 20:42:29 +00:00
..
abstime.sql Add a "USING" clause to DELETE, which is equivalent to the FROM clause 2005-04-07 01:51:41 +00:00
aggregates.sql SQL2003-standard statistical aggregates, by Sergey Koposov. I've added only 2006-07-28 18:33:04 +00:00
alter_table.sql Fix up foreign-key mechanism so that there is a sound semantic basis for the 2007-02-14 01:58:58 +00:00
arrays.sql Fix the problem that creating a user-defined type named _foo, followed by one 2007-05-12 00:55:00 +00:00
bit.sql Make bit and bit varying types reject too long input. (They already tried 2001-05-22 16:37:17 +00:00
boolean.sql Allow leading and trailing whitespace in the input to the boolean 2007-06-01 23:40:19 +00:00
box.sql Rename contains/contained-by operators to @> and <@, per discussion that 2006-09-10 00:29:35 +00:00
btree_index.sql Clean up header for uniform appearance throughout tests. 2000-01-06 06:41:55 +00:00
case.sql Adjust constant-folding of CASE expressions so that the simple comparison 2005-02-02 21:49:09 +00:00
char.sql Add a "USING" clause to DELETE, which is equivalent to the FROM clause 2005-04-07 01:51:41 +00:00
circle.sql Support ORDER BY ... NULLS FIRST/LAST, and add ASC/DESC/NULLS FIRST/NULLS LAST 2007-01-09 02:14:16 +00:00
cluster.sql Add an ORDER BY to nail down the expected row order from a query that's 2007-09-03 01:28:40 +00:00
combocid.sql Avoid incrementing the CommandCounter when CommandCounterIncrement is called 2007-11-30 21:22:54 +00:00
comments.sql Implement nested block comments in the backend and in psql. 2000-07-14 15:43:57 +00:00
conversion.sql Remove "convert 'blah' using conversion_name" facility, because if it 2007-09-24 01:29:30 +00:00
copy2.sql Clean up CREATE FUNCTION syntax usage in contrib and elsewhere, in 2006-02-27 16:09:50 +00:00
copyselect.sql Extend COPY to support COPY (SELECT ...) TO ... 2006-08-30 23:34:22 +00:00
create_aggregate.sql Create AVG() aggregates for int8 and NUMERIC which do not compute X^2, 2007-02-17 00:55:58 +00:00
create_index.sql Make 'col IS NULL' clauses be indexable conditions. 2007-04-06 22:33:43 +00:00
create_misc.sql Add a "USING" clause to DELETE, which is equivalent to the FROM clause 2005-04-07 01:51:41 +00:00
create_operator.sql Attached is a patch implementing factorial(), returning numeric. Points 2003-12-01 21:52:38 +00:00
create_table.sql Tsearch2 functionality migrates to core. The bulk of this work is by 2007-08-21 01:11:32 +00:00
create_type.sql Support type modifiers for user-defined types, and pull most knowledge 2006-12-30 21:21:56 +00:00
create_view.sql Add a "USING" clause to DELETE, which is equivalent to the FROM clause 2005-04-07 01:51:41 +00:00
date.sql > After all that about numbering centuries and millenia correctly, 2004-08-20 03:45:14 +00:00
delete.sql Allow an optional alias for the target table to be specified for UPDATE 2006-01-22 05:20:35 +00:00
dependency.sql Fix all known problems with pg_dump's handling of serial sequences 2006-08-21 00:57:26 +00:00
domain.sql Fix select_common_type() so that it can select a domain type, if all inputs 2007-11-26 16:46:51 +00:00
drop_if_exists.sql DROP IF EXISTS for ROLE/USER/GROUP 2006-02-04 19:06:47 +00:00
drop.sql Add a bunch of pseudo-types to replace the behavior formerly associated 2002-08-22 00:01:51 +00:00
enum.sql Support enum data types. Along the way, use macros for the values of 2007-04-02 03:49:42 +00:00
errors.sql Add a regression test to verify that the stack depth checker actually 2005-02-11 22:15:12 +00:00
euc_cn.sql Hi, here are the patches to enhance existing MB handling. This time 1998-06-16 07:29:54 +00:00
euc_jp.sql From: t-ishii@sra.co.jp 1998-04-27 17:10:50 +00:00
euc_kr.sql Hi, here are the patches to enhance existing MB handling. This time 1998-06-16 07:29:54 +00:00
euc_tw.sql Add missing mb files. 1999-02-02 19:04:43 +00:00
float4.sql Fix float4/8 to handle Infinity and Nan consistently, e.g. Infinity is a 2007-01-02 20:00:50 +00:00
float8.sql Remove grammar productions for prefix and postfix % and ^ operators, 2005-06-08 21:15:29 +00:00
foreign_key.sql Repair problems occurring when multiple RI updates have to be done to the same 2007-08-15 19:15:47 +00:00
geometry.sql Stop a few regression tests from needlessly disabling GEQO. This was 2007-05-29 04:17:08 +00:00
guc.sql Arrange for SET LOCAL's effects to persist until the end of the current top 2007-09-11 00:06:42 +00:00
hash_index.sql Add a "USING" clause to DELETE, which is equivalent to the FROM clause 2005-04-07 01:51:41 +00:00
horology.sql Adjust horology test to avoid join-plan-dependent result ordering in 2007-07-25 17:22:37 +00:00
inet.sql Fix incorrect addition, subtraction, and overflow checking in new 2006-02-11 20:39:59 +00:00
inherit.sql Implement CREATE TABLE LIKE ... INCLUDING INDEXES. Patch from NikhilS, 2007-07-17 05:02:03 +00:00
insert.sql A few regression tests for VALUES, from Gavin Sherry. 2006-08-03 14:54:44 +00:00
int2.sql Add a "USING" clause to DELETE, which is equivalent to the FROM clause 2005-04-07 01:51:41 +00:00
int4.sql Add a "USING" clause to DELETE, which is equivalent to the FROM clause 2005-04-07 01:51:41 +00:00
int8.sql Add regression test to see if the min/max values of int8 convert correctly. 2005-12-05 04:13:38 +00:00
interval.sql Fix a bug in input processing for the "interval" type. Previously, 2007-05-29 04:58:43 +00:00
join.sql Fix some planner issues found while investigating Kevin Grittner's report 2008-01-09 20:42:29 +00:00
limit.sql Fix parameter recalculation for Limit nodes: during a ReScan call we must 2007-05-17 19:35:08 +00:00
lseg.sql Clean up format of tests. 2000-01-05 06:07:58 +00:00
money.sql Add regression tests for MONEY type. 2007-11-24 19:49:23 +00:00
mule_internal.sql Hi, here are the patches to enhance existing MB handling. This time 1998-06-16 07:29:54 +00:00
name.sql Add a "USING" clause to DELETE, which is equivalent to the FROM clause 2005-04-07 01:51:41 +00:00
namespace.sql Add CREATE TRIGGER, CREATE INDEX, and CREATE SEQUENCE to the list of 2004-01-11 04:58:17 +00:00
numeric_big.sql Update numeric_big regress test for 7.0. This has apparently been 2000-03-30 07:13:20 +00:00
numeric.sql Tweak the width_bucket() regression tests to avoid an unnecessary 2007-01-17 16:19:08 +00:00
numerology.sql Tweak GROUP BY so that it will still accept result-column names, but only 2000-03-15 23:31:19 +00:00
oid.sql Add a "USING" clause to DELETE, which is equivalent to the FROM clause 2005-04-07 01:51:41 +00:00
oidjoins.sql Tsearch2 functionality migrates to core. The bulk of this work is by 2007-08-21 01:11:32 +00:00
opr_sanity.sql Make casts from xml to text independent of the XML option setting, thus 2007-11-27 12:21:05 +00:00
path.sql Clean up format of tests. 2000-01-05 06:07:58 +00:00
plancache.sql Repair bug that allowed RevalidateCachedPlan to attempt to rebuild a cached 2007-11-30 18:38:34 +00:00
plpgsql.sql Implement RETURN QUERY for PL/PgSQL. This provides some convenient syntax 2007-07-25 04:19:09 +00:00
point.sql Stop a few regression tests from needlessly disabling GEQO. This was 2007-05-29 04:17:08 +00:00
polygon.sql Rename contains/contained-by operators to @> and <@, per discussion that 2006-09-10 00:29:35 +00:00
polymorphism.sql Fix a thinko in my patch of a couple months ago for bug #3116: it did the 2007-05-01 18:53:52 +00:00
portals_p2.sql Partial indexes work again, courtesy of Martijn van Oosterhout. 2001-07-16 05:07:00 +00:00
portals.sql Disallow scrolling of FOR UPDATE/FOR SHARE cursors, so as to avoid problems 2007-10-24 23:27:08 +00:00
prepare.sql Insert ORDER BY into a few regression test queries that now have unstable 2007-06-09 17:24:46 +00:00
prepared_xacts.sql Two-phase commit. Original patch by Heikki Linnakangas, with additional 2005-06-17 22:32:51 +00:00
privileges.sql Get rid of the separate RULE privilege for tables: now only a table's owner 2006-09-05 21:08:36 +00:00
random.sql Improve random regression tests to fail less frequently. 2004-03-15 15:46:25 +00:00
rangefuncs.sql Clean up CREATE FUNCTION syntax usage in contrib and elsewhere, in 2006-02-27 16:09:50 +00:00
reltime.sql Add a "USING" clause to DELETE, which is equivalent to the FROM clause 2005-04-07 01:51:41 +00:00
returning.sql Apply a simple solution to the problem of making INSERT/UPDATE/DELETE 2006-09-02 17:06:52 +00:00
rowtypes.sql Support varlena fields with single-byte headers and unaligned storage. 2007-04-06 04:21:44 +00:00
rules.sql Repair two constraint-exclusion corner cases triggered by proving that an 2007-05-26 18:23:02 +00:00
sanity_check.sql Tweak sanity_check regression test to display more tables (viz, those 2006-08-06 04:35:21 +00:00
select_distinct_on.sql Redesign DISTINCT ON as discussed in pgsql-sql 1/25/00: syntax is now 2000-01-27 18:11:50 +00:00
select_distinct.sql Implement IS NOT DISTINCT FROM, update the regression tests and docs. 2005-12-11 10:54:28 +00:00
select_having.sql Make the behavior of HAVING without GROUP BY conform to the SQL spec. 2005-03-10 23:21:26 +00:00
select_implicit.sql Finish implementation of hashed aggregation. Add enable_hashagg GUC 2002-11-21 00:42:20 +00:00
select_into.sql Remove FROM warning by fixing query. 2000-06-04 17:52:54 +00:00
select_views.sql Clean up header for uniform appearance throughout tests. 2000-01-06 06:41:55 +00:00
select.sql Fix a couple of planner bugs introduced by the new ability to discard 2007-07-07 20:46:45 +00:00
sequence.sql Change nextval and other sequence functions to specify their sequence 2005-10-02 23:50:16 +00:00
sql_ascii.sql Add SQL_ASCII encoding test case 2000-03-06 01:29:54 +00:00
stats.sql Simplify and rename some GUC variables, per various recent discussions: 2007-09-24 03:12:23 +00:00
strings.sql Code review for regexp_matches/regexp_split patch. Refactor to avoid assuming 2007-08-11 03:56:24 +00:00
subselect.sql Fix an old thinko in SS_make_initplan_from_plan, which is used when optimizing 2007-07-18 21:40:57 +00:00
temp.sql Support explicit placement of the temporary-table schema within search_path. 2007-04-20 02:37:38 +00:00
text.sql Fix up text concatenation so that it accepts all the reasonable cases that 2007-06-06 23:00:50 +00:00
time.sql Please find attached two patches for documentation and regression tests 2006-07-06 01:46:38 +00:00
timestamp.sql Install a more correct fix in the timestamp and timestamptz regression tests: 2007-02-16 17:49:15 +00:00
timestamptz.sql Use "alternative" instead of "alternate" where it is clearer. 2007-11-07 12:24:24 +00:00
timetz.sql Please find attached two patches for documentation and regression tests 2006-07-06 01:46:38 +00:00
tinterval.sql Stop a few regression tests from needlessly disabling GEQO. This was 2007-05-29 04:17:08 +00:00
transactions.sql Insert ORDER BY into a few regression test queries that now have unstable 2007-06-09 17:24:46 +00:00
triggers.sql Change the row constructor syntax (ROW(...)) so that list elements foo.* 2006-06-26 17:24:41 +00:00
truncate.sql Change TRUNCATE's method for searching for foreign-key references so that 2006-06-29 16:07:29 +00:00
tsdicts.sql Rename and slightly redefine the default text search parser's "word" 2007-10-23 20:46:12 +00:00
tsearch.sql Fix attribution for Rime of the Ancient Mariner (obviously it's been 2007-12-10 00:12:31 +00:00
tstypes.sql Fix tsvectorout() and tsqueryout() to escape backslesh, add test of that. 2007-11-16 15:05:59 +00:00
txid.sql Migrate the former contrib/txid module into core. This will make it easier 2007-10-13 23:06:28 +00:00
type_sanity.sql Strengthen type_sanity's check on pg_type.typarray. It failed to 2007-10-13 22:33:38 +00:00
union.sql Adjust data types in some of the UNION tests to avoid potentially 2003-11-02 22:35:26 +00:00
update.sql Code review for UPDATE SET (columnlist) patch. Make it handle as much 2006-09-03 22:37:06 +00:00
uuid.sql Rewrite uuid input and output routines to avoid dependency on the 2007-01-31 19:33:54 +00:00
vacuum.sql Add new vacuum regression test files. 2002-07-20 04:58:14 +00:00
varchar.sql Add a "USING" clause to DELETE, which is equivalent to the FROM clause 2005-04-07 01:51:41 +00:00
without_oid.sql Combine cmin and cmax fields of HeapTupleHeaders into a single field, by 2007-02-09 03:35:35 +00:00
xml.sql Allow XML processing instructions starting with "xml" while prohibiting 2007-11-09 15:52:51 +00:00