1
0
mirror of https://github.com/postgres/postgres.git synced 2025-12-21 05:21:08 +03:00

Teach planner about the idea that a mergejoin won't necessarily read

both input streams to the end.  If one variable's range is much less
than the other, an indexscan-based merge can win by not scanning all
of the other table.  Per example from Reinhard Max.
This commit is contained in:
Tom Lane
2002-03-01 04:09:28 +00:00
parent fdc60bd9d9
commit f8c109528c
6 changed files with 422 additions and 113 deletions

View File

@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: selfuncs.h,v 1.4 2001/11/05 17:46:36 momjian Exp $
* $Id: selfuncs.h,v 1.5 2002/03/01 04:09:28 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -66,8 +66,12 @@ extern Datum icregexnejoinsel(PG_FUNCTION_ARGS);
extern Datum nlikejoinsel(PG_FUNCTION_ARGS);
extern Datum icnlikejoinsel(PG_FUNCTION_ARGS);
Selectivity booltestsel(Query *root, BooleanTest *clause, int varRelid);
Selectivity nulltestsel(Query *root, NullTest *clause, int varRelid);
extern Selectivity booltestsel(Query *root, BooleanTest *clause, int varRelid);
extern Selectivity nulltestsel(Query *root, NullTest *clause, int varRelid);
extern void mergejoinscansel(Query *root, Node *clause,
Selectivity *leftscan,
Selectivity *rightscan);
extern Datum btcostestimate(PG_FUNCTION_ARGS);
extern Datum rtcostestimate(PG_FUNCTION_ARGS);