internal.h 2.1 KB
Newer Older
1 2
/*-------------------------------------------------------------------------
 *
3
 * internal.h
4
 *	  Definitions required throughout the query optimizer.
5 6 7 8
 *
 *
 * Copyright (c) 1994, Regents of the University of California
 *
T
Tom Lane 已提交
9
 * $Id: internal.h,v 1.19 1999/05/16 19:45:36 tgl Exp $
10 11 12 13 14 15
 *
 *-------------------------------------------------------------------------
 */
#ifndef INTERNAL_H
#define INTERNAL_H

16 17 18 19 20 21 22
/*
 *		---------- SHARED MACROS
 *
 *		Macros common to modules for creating, accessing, and modifying
 *		query tree and query plan components.
 *		Shared with the executor.
 *
23 24 25 26
 */


/*
27 28
 *		System-dependent tuning constants
 *
29
 */
T
Tom Lane 已提交
30
#define _CPU_PAGE_WEIGHT_  0.033  /* CPU-heap-to-page cost weighting factor */
31 32 33 34 35 36 37 38 39
#define _CPU_INDEX_PAGE_WEIGHT_ 0.017	/* CPU-index-to-page cost
										 * weighting factor */
#define _MAX_KEYS_	   INDEX_MAX_KEYS	/* maximum number of keys in an
										 * index */
#define _TID_SIZE_	   6		/* sizeof(itemid) (from ../h/itemid.h) */

/*
 *		Size estimates
 *
40 41
 */

42
/*	   The cost of sequentially scanning a materialized temporary relation
43
 */
44
#define _NONAME_SCAN_COST_		10
45

46
/*	   The number of pages and tuples in a materialized relation
47
 */
48 49
#define _NONAME_RELATION_PAGES_			1
#define _NONAME_RELATION_TUPLES_	10
50

51
/*	   The length of a variable-length field in bytes
52 53 54
 */
#define _DEFAULT_ATTRIBUTE_WIDTH_ (2 * _TID_SIZE_)

55 56 57
/*
 *		Flags and identifiers
 *
58 59
 */

60
/*	   Identifier for (sort) temp relations   */
61
/* used to be -1 */
62
#define _NONAME_RELATION_ID_	 InvalidOid
63

64 65
/*	   Identifier for invalid relation OIDs and attribute numbers for use by
 *	   selectivity functions
66
 */
T
Tom Lane 已提交
67
#define _SELEC_VALUE_UNKNOWN_	(-1)
68

69 70 71
/*	   Flag indicating that a clause constant is really a parameter (or other
 *		non-constant?), a non-parameter, or a constant on the right side
 *		of the clause.
72 73 74 75 76 77
 */
#define _SELEC_NOT_CONSTANT_   0
#define _SELEC_IS_CONSTANT_    1
#define _SELEC_CONSTANT_LEFT_  0
#define _SELEC_CONSTANT_RIGHT_ 2

78
/* #define deactivate_joininfo(joininfo)		joininfo->inactive=true*/
79 80
/*#define joininfo_inactive(joininfo)	joininfo->inactive */

V
Vadim B. Mikheev 已提交
81
/* GEQO switch according to number of relations in a query */
B
Bruce Momjian 已提交
82
#define GEQO_RELS 11
V
Vadim B. Mikheev 已提交
83

84
#endif	 /* INTERNAL_H */