1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-27 00:12:01 +03:00

If a LIMIT is applied to a UNION ALL query, plan each UNION arm as

if the limit were directly applied to it.  This does not actually
add a LIMIT plan node to the generated subqueries --- that would be
useless overhead --- but it does cause the planner to prefer fast-
start plans when the limit is small.  After an idea from Phil Endecott.
This commit is contained in:
Tom Lane
2005-06-10 02:21:05 +00:00
parent 39cee73889
commit 3b167a4099
3 changed files with 178 additions and 118 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/optimizer/prep.h,v 1.50 2005/06/05 22:32:58 tgl Exp $
* $PostgreSQL: pgsql/src/include/optimizer/prep.h,v 1.51 2005/06/10 02:21:05 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -45,7 +45,8 @@ extern List *preprocess_targetlist(PlannerInfo *root, List *tlist);
/*
* prototypes for prepunion.c
*/
extern Plan *plan_set_operations(PlannerInfo *root, List **sortClauses);
extern Plan *plan_set_operations(PlannerInfo *root, double tuple_fraction,
List **sortClauses);
extern List *find_all_inheritors(Oid parentrel);