1 /*-------------------------------------------------------------------------
4 * index strategy type definitions
5 * (separated out from original istrat.h to avoid circular refs)
8 * Copyright (c) 1994, Regents of the University of California
10 * $Id: strat.h,v 1.11 1998/09/01 04:34:30 momjian Exp $
12 *-------------------------------------------------------------------------
17 #include <access/skey.h>
19 typedef uint16 StrategyNumber;
21 #define InvalidStrategy 0
23 typedef struct StrategyTransformMapData
25 StrategyNumber strategy[1]; /* VARIABLE LENGTH ARRAY */
26 } StrategyTransformMapData; /* VARIABLE LENGTH
36 typedef StrategyTransformMapData *StrategyTransformMap;
38 typedef struct StrategyOperatorData
40 StrategyNumber strategy;
41 bits16 flags; /* scan qualification flags h/skey.h */
42 } StrategyOperatorData;
44 typedef StrategyOperatorData *StrategyOperator;
46 typedef struct StrategyTermData
47 { /* conjunctive term */
49 StrategyOperatorData operatorData[1]; /* VARIABLE LENGTH */
50 } StrategyTermData; /* VARIABLE LENGTH STRUCTURE */
52 typedef StrategyTermData *StrategyTerm;
54 typedef struct StrategyExpressionData
55 { /* disjunctive normal form */
56 StrategyTerm term[1]; /* VARIABLE LENGTH ARRAY */
57 } StrategyExpressionData; /* VARIABLE LENGTH STRUCTURE */
59 typedef StrategyExpressionData *StrategyExpression;
61 typedef struct StrategyEvaluationData
63 StrategyNumber maxStrategy;
64 StrategyTransformMap negateTransform;
65 StrategyTransformMap commuteTransform;
66 StrategyTransformMap negateCommuteTransform;
67 StrategyExpression expression[12]; /* XXX VARIABLE LENGTH */
68 } StrategyEvaluationData; /* VARIABLE LENGTH STRUCTURE */
70 typedef StrategyEvaluationData *StrategyEvaluation;
73 * StrategyTransformMapIsValid --
74 * Returns true iff strategy transformation map is valid.
76 #define StrategyTransformMapIsValid(transform) PointerIsValid(transform)
79 #define AMStrategies(foo) (foo)
81 typedef struct StrategyMapData
83 ScanKeyData entry[1]; /* VARIABLE LENGTH ARRAY */
84 } StrategyMapData; /* VARIABLE LENGTH STRUCTURE */
86 typedef StrategyMapData *StrategyMap;
88 typedef struct IndexStrategyData
90 StrategyMapData strategyMapData[1]; /* VARIABLE LENGTH ARRAY */
91 } IndexStrategyData; /* VARIABLE LENGTH STRUCTURE */
93 typedef IndexStrategyData *IndexStrategy;