mirror of
https://github.com/postgres/postgres.git
synced 2026-03-13 22:28:01 -04:00
Allowing sub-select containing LIMIT/OFFSET in workers can lead to inconsistent results at the top-level as there is no guarantee that the row order will be fully deterministic. The fix is to prohibit pushing LIMIT/OFFSET within sub-selects to workers. Reported-by: Andrew Fletcher Bug: 15324 Author: Amit Kapila Reviewed-by: Dilip Kumar Backpatch-through: 9.6 Discussion: https://postgr.es/m/153417684333.10284.11356259990921828616@wrigleys.postgresql.org
64 lines
2 KiB
C
64 lines
2 KiB
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* planner.h
|
|
* prototypes for planner.c.
|
|
*
|
|
*
|
|
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
*
|
|
* src/include/optimizer/planner.h
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef PLANNER_H
|
|
#define PLANNER_H
|
|
|
|
#include "nodes/plannodes.h"
|
|
#include "nodes/relation.h"
|
|
|
|
|
|
/* Hook for plugins to get control in planner() */
|
|
typedef PlannedStmt *(*planner_hook_type) (Query *parse,
|
|
int cursorOptions,
|
|
ParamListInfo boundParams);
|
|
extern PGDLLIMPORT planner_hook_type planner_hook;
|
|
|
|
/* Hook for plugins to get control when grouping_planner() plans upper rels */
|
|
typedef void (*create_upper_paths_hook_type) (PlannerInfo *root,
|
|
UpperRelationKind stage,
|
|
RelOptInfo *input_rel,
|
|
RelOptInfo *output_rel,
|
|
void *extra);
|
|
extern PGDLLIMPORT create_upper_paths_hook_type create_upper_paths_hook;
|
|
|
|
|
|
extern PlannedStmt *planner(Query *parse, int cursorOptions,
|
|
ParamListInfo boundParams);
|
|
extern PlannedStmt *standard_planner(Query *parse, int cursorOptions,
|
|
ParamListInfo boundParams);
|
|
|
|
extern PlannerInfo *subquery_planner(PlannerGlobal *glob, Query *parse,
|
|
PlannerInfo *parent_root,
|
|
bool hasRecursion, double tuple_fraction);
|
|
|
|
extern bool is_dummy_plan(Plan *plan);
|
|
|
|
extern RowMarkType select_rowmark_type(RangeTblEntry *rte,
|
|
LockClauseStrength strength);
|
|
|
|
extern bool limit_needed(Query *parse);
|
|
|
|
extern void mark_partial_aggref(Aggref *agg, AggSplit aggsplit);
|
|
|
|
extern Path *get_cheapest_fractional_path(RelOptInfo *rel,
|
|
double tuple_fraction);
|
|
|
|
extern Expr *expression_planner(Expr *expr);
|
|
|
|
extern Expr *preprocess_phv_expression(PlannerInfo *root, Expr *expr);
|
|
|
|
extern bool plan_cluster_use_sort(Oid tableOid, Oid indexOid);
|
|
extern int plan_create_index_workers(Oid tableOid, Oid indexOid);
|
|
|
|
#endif /* PLANNER_H */
|