mirror of
https://github.com/postgres/postgres.git
synced 2025-10-27 00:12:01 +03:00
Reimplement nodeMaterial to use a temporary BufFile (or even memory, if the
materialized tupleset is small enough) instead of a temporary relation. This was something I was thinking of doing anyway for performance, and Jan says he needs it for TOAST because he doesn't want to cope with toasting noname relations. With this change, the 'noname table' support in heap.c is dead code, and I have accordingly removed it. Also clean up 'noname' plan handling in planner --- nonames are either sort or materialize plans, and it seems less confusing to handle them separately under those names.
This commit is contained in:
@@ -1,54 +0,0 @@
|
||||
/*-------------------------------------------------------------------------
|
||||
*
|
||||
* internal.h
|
||||
* Definitions required throughout the query optimizer.
|
||||
*
|
||||
*
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: internal.h,v 1.27 2000/06/15 03:32:51 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
#ifndef INTERNAL_H
|
||||
#define INTERNAL_H
|
||||
|
||||
/*
|
||||
* ---------- SHARED MACROS
|
||||
*
|
||||
* Macros common to modules for creating, accessing, and modifying
|
||||
* query tree and query plan components.
|
||||
* Shared with the executor.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* Size estimates
|
||||
*
|
||||
*/
|
||||
|
||||
/* The cost of sequentially scanning a materialized temporary relation
|
||||
*/
|
||||
#define _NONAME_SCAN_COST_ 10
|
||||
|
||||
/* The number of pages and tuples in a materialized relation
|
||||
*/
|
||||
#define _NONAME_RELATION_PAGES_ 1
|
||||
#define _NONAME_RELATION_TUPLES_ 10
|
||||
|
||||
/* The length of a variable-length field in bytes (stupid estimate...)
|
||||
*/
|
||||
#define _DEFAULT_ATTRIBUTE_WIDTH_ 12
|
||||
|
||||
/*
|
||||
* Flags and identifiers
|
||||
*
|
||||
*/
|
||||
|
||||
/* Identifier for (sort) temp relations */
|
||||
/* used to be -1 */
|
||||
#define _NONAME_RELATION_ID_ InvalidOid
|
||||
|
||||
#endif /* INTERNAL_H */
|
||||
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: planmain.h,v 1.41 2000/06/08 22:37:51 momjian Exp $
|
||||
* $Id: planmain.h,v 1.42 2000/06/18 22:44:33 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -27,12 +27,13 @@ extern Plan *query_planner(Query *root, List *tlist, List *qual,
|
||||
* prototypes for plan/createplan.c
|
||||
*/
|
||||
extern Plan *create_plan(Query *root, Path *best_path);
|
||||
extern Sort *make_sort(List *tlist, Oid nonameid, Plan *lefttree,
|
||||
int keycount);
|
||||
extern Sort *make_sort(List *tlist, Plan *lefttree, int keycount);
|
||||
extern Sort *make_sort_from_pathkeys(List *tlist, Plan *lefttree,
|
||||
List *pathkeys);
|
||||
extern Agg *make_agg(List *tlist, List *qual, Plan *lefttree);
|
||||
extern Group *make_group(List *tlist, bool tuplePerGroup, int ngrp,
|
||||
AttrNumber *grpColIdx, Plan *lefttree);
|
||||
extern Noname *make_noname(List *tlist, List *pathkeys, Plan *subplan);
|
||||
extern Material *make_material(List *tlist, Plan *lefttree);
|
||||
extern Unique *make_unique(List *tlist, Plan *lefttree, List *distinctList);
|
||||
extern Result *make_result(List *tlist, Node *resconstantqual, Plan *subplan);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user