mirror of
https://github.com/postgres/postgres.git
synced 2025-06-05 23:56:58 +03:00
node now does its own grouping of the input rows, and has no need for a preceding GROUP node in the plan pipeline. This allows elimination of the misnamed tuplePerGroup option for GROUP, and actually saves more code in nodeGroup.c than it costs in nodeAgg.c, as well as being presumably faster. Restructure the API of query_planner so that we do not commit to using a sorted or unsorted plan in query_planner; instead grouping_planner makes the decision. (Right now it isn't any smarter than query_planner was, but that will change as soon as it has the option to select a hash- based aggregation step.) Despite all the hackery, no initdb needed since only in-memory node types changed.
85 lines
2.6 KiB
C
85 lines
2.6 KiB
C
/*-------------------------------------------------------------------------
|
|
*
|
|
* pathnode.h
|
|
* prototypes for pathnode.c, relnode.c.
|
|
*
|
|
*
|
|
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
|
* Portions Copyright (c) 1994, Regents of the University of California
|
|
*
|
|
* $Id: pathnode.h,v 1.45 2002/11/06 00:00:45 tgl Exp $
|
|
*
|
|
*-------------------------------------------------------------------------
|
|
*/
|
|
#ifndef PATHNODE_H
|
|
#define PATHNODE_H
|
|
|
|
#include "nodes/relation.h"
|
|
|
|
/*
|
|
* prototypes for pathnode.c
|
|
*/
|
|
extern int compare_path_costs(Path *path1, Path *path2,
|
|
CostSelector criterion);
|
|
extern int compare_fractional_path_costs(Path *path1, Path *path2,
|
|
double fraction);
|
|
extern void set_cheapest(RelOptInfo *parent_rel);
|
|
extern void add_path(RelOptInfo *parent_rel, Path *new_path);
|
|
|
|
extern Path *create_seqscan_path(Query *root, RelOptInfo *rel);
|
|
extern IndexPath *create_index_path(Query *root, RelOptInfo *rel,
|
|
IndexOptInfo *index,
|
|
List *restriction_clauses,
|
|
List *pathkeys,
|
|
ScanDirection indexscandir);
|
|
extern TidPath *create_tidscan_path(Query *root, RelOptInfo *rel,
|
|
List *tideval);
|
|
extern AppendPath *create_append_path(RelOptInfo *rel, List *subpaths);
|
|
extern ResultPath *create_result_path(RelOptInfo *rel, Path *subpath,
|
|
List *constantqual);
|
|
extern Path *create_subqueryscan_path(RelOptInfo *rel);
|
|
extern Path *create_functionscan_path(Query *root, RelOptInfo *rel);
|
|
|
|
extern NestPath *create_nestloop_path(Query *root,
|
|
RelOptInfo *joinrel,
|
|
JoinType jointype,
|
|
Path *outer_path,
|
|
Path *inner_path,
|
|
List *restrict_clauses,
|
|
List *pathkeys);
|
|
|
|
extern MergePath *create_mergejoin_path(Query *root,
|
|
RelOptInfo *joinrel,
|
|
JoinType jointype,
|
|
Path *outer_path,
|
|
Path *inner_path,
|
|
List *restrict_clauses,
|
|
List *pathkeys,
|
|
List *mergeclauses,
|
|
List *outersortkeys,
|
|
List *innersortkeys);
|
|
|
|
extern HashPath *create_hashjoin_path(Query *root,
|
|
RelOptInfo *joinrel,
|
|
JoinType jointype,
|
|
Path *outer_path,
|
|
Path *inner_path,
|
|
List *restrict_clauses,
|
|
List *hashclauses);
|
|
|
|
/*
|
|
* prototypes for relnode.c
|
|
*/
|
|
extern void build_base_rel(Query *root, int relid);
|
|
extern RelOptInfo *build_other_rel(Query *root, int relid);
|
|
extern RelOptInfo *find_base_rel(Query *root, int relid);
|
|
extern RelOptInfo *find_other_rel(Query *root, int relid);
|
|
extern RelOptInfo *find_other_rel_for_join(Query *root, List *relids);
|
|
extern RelOptInfo *build_join_rel(Query *root,
|
|
RelOptInfo *outer_rel,
|
|
RelOptInfo *inner_rel,
|
|
JoinType jointype,
|
|
List **restrictlist_ptr);
|
|
|
|
#endif /* PATHNODE_H */
|