Tid access method feature from Hiroshi Inoue, Inoue@tpf.co.jp

This commit is contained in:
Bruce Momjian
1999-11-23 20:07:06 +00:00
parent 54ffd4677a
commit 6f9ff92cc0
28 changed files with 1396 additions and 32 deletions

View File

@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: execnodes.h,v 1.37 1999/10/17 22:15:07 tgl Exp $
* $Id: execnodes.h,v 1.38 1999/11/23 20:07:02 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -414,6 +414,37 @@ typedef struct IndexScanState
HeapTupleData iss_htup;
} IndexScanState;
/* ----------------
* TidScanState information
*
*| tid scans don't use CommonScanState because
*| the underlying AM abstractions for heap scans and
*| tid scans are too different.. It would be nice
*| if the current abstraction was more useful but ... -cim 10/15/89
*
* TidPtr current tid in use
* NumTids number of tids in this scan
* tidList evaluated item pointers
*
* CommonState information
*
* OuterTupleSlot pointer to slot containing current "outer" tuple
* ResultTupleSlot pointer to slot in tuple table for projected tuple
* ExprContext node's current expression context
* ProjInfo info this node uses to form tuple projections
* NumScanAttributes size of ScanAttributes array
* ScanAttributes attribute numbers of interest in this tuple
* ----------------
*/
typedef struct TidScanState
{
CommonState cstate; /* its first field is NodeTag */
int tss_NumTids;
int tss_TidPtr;
int tss_MarkTidPtr;
ItemPointer *tss_TidList;
HeapTupleData tss_htup;
} TidScanState;
/* ----------------------------------------------------------------
* Join State Information

View File

@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: nodes.h,v 1.55 1999/10/15 01:49:47 momjian Exp $
* $Id: nodes.h,v 1.56 1999/11/23 20:07:02 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -47,6 +47,7 @@ typedef enum NodeTag
T_Choose,
T_Group,
T_SubPlan,
T_TidScan,
/*---------------------
* TAGS FOR PRIMITIVE NODES (primnodes.h)
@ -80,6 +81,7 @@ typedef enum NodeTag
T_RestrictInfo,
T_JoinInfo,
T_Stream,
T_TidPath,
/*---------------------
* TAGS FOR EXECUTOR NODES (execnodes.h)
@ -110,6 +112,7 @@ typedef enum NodeTag
T_SortState,
T_UniqueState,
T_HashState,
T_TidScanState,
/*---------------------
* TAGS FOR MEMORY NODES (memnodes.h)

View File

@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: plannodes.h,v 1.33 1999/11/15 03:28:06 tgl Exp $
* $Id: plannodes.h,v 1.34 1999/11/23 20:07:02 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -179,7 +179,19 @@ typedef struct IndexScan
IndexScanState *indxstate;
} IndexScan;
/*
/* ----------------
* tid scan node
* ----------------
*/
typedef struct TidScan
{
Scan scan;
bool needRescan;
List *tideval;
TidScanState *tidstate;
} TidScan;
/*
* ==========
* Join nodes
* ==========

View File

@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: relation.h,v 1.38 1999/08/16 02:17:40 tgl Exp $
* $Id: relation.h,v 1.39 1999/11/23 20:07:02 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -193,6 +193,13 @@ typedef struct IndexPath
Relids joinrelids; /* other rels mentioned in indexqual */
} IndexPath;
typedef struct TidPath
{
Path path;
List *tideval;
Relids unjoined_relids; /* some rels not yet part of my Path */
} TidPath;
/*
* All join-type paths share these fields.
*/

View File

@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: cost.h,v 1.23 1999/08/06 04:00:13 tgl Exp $
* $Id: cost.h,v 1.24 1999/11/23 20:07:05 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -31,11 +31,13 @@ extern bool _enable_sort_;
extern bool _enable_nestloop_;
extern bool _enable_mergejoin_;
extern bool _enable_hashjoin_;
extern bool _enable_tidscan_;
extern Cost cost_seqscan(int relid, int relpages, int reltuples);
extern Cost cost_index(Oid indexid, int expected_indexpages, Cost selec,
int relpages, int reltuples, int indexpages,
int indextuples, bool is_injoin);
extern Cost cost_tidscan(List *evallist);
extern Cost cost_sort(List *pathkeys, int tuples, int width);
extern Cost cost_nestloop(Cost outercost, Cost innercost, int outertuples,
int innertuples, int outerpages, bool is_indexjoin);

View File

@ -6,7 +6,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: pathnode.h,v 1.21 1999/08/16 02:17:45 tgl Exp $
* $Id: pathnode.h,v 1.22 1999/11/23 20:07:06 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -27,6 +27,7 @@ extern Path *create_seqscan_path(RelOptInfo *rel);
extern IndexPath *create_index_path(Query *root, RelOptInfo *rel,
RelOptInfo *index, List *restriction_clauses);
extern TidPath *create_tidscan_path(RelOptInfo *rel, List *tideval);
extern NestPath *create_nestloop_path(RelOptInfo *joinrel,
RelOptInfo *outer_rel, Path *outer_path, Path *inner_path,

View File

@ -7,7 +7,7 @@
*
* Copyright (c) 1994, Regents of the University of California
*
* $Id: paths.h,v 1.35 1999/08/21 03:49:15 tgl Exp $
* $Id: paths.h,v 1.36 1999/11/23 20:07:06 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@ -30,6 +30,12 @@ extern List *create_index_paths(Query *root, RelOptInfo *rel, List *indices,
List *joininfo_list);
extern List *expand_indexqual_conditions(List *indexquals);
/*
* tidpath.h
* routines to generate tid paths
*/
extern List *create_tidscan_paths(Query *root, RelOptInfo *rel);
/*
* joinpath.c
* routines to create join paths