diff options
Diffstat (limited to 'src/backend/access/strat.h')
-rw-r--r-- | src/backend/access/strat.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/backend/access/strat.h b/src/backend/access/strat.h new file mode 100644 index 00000000000..4ddb2190d88 --- /dev/null +++ b/src/backend/access/strat.h @@ -0,0 +1,86 @@ +/*------------------------------------------------------------------------- + * + * strat.h-- + * index strategy type definitions + * (separated out from original istrat.h to avoid circular refs) + * + * + * Copyright (c) 1994, Regents of the University of California + * + * $Id: strat.h,v 1.1.1.1 1996/07/09 06:21:09 scrappy Exp $ + * + *------------------------------------------------------------------------- + */ +#ifndef STRAT_H +#define STRAT_H + +#include "postgres.h" +#include "access/attnum.h" +#include "access/skey.h" + +typedef uint16 StrategyNumber; + +#define InvalidStrategy 0 + +typedef struct StrategyTransformMapData { + StrategyNumber strategy[1]; /* VARIABLE LENGTH ARRAY */ +} StrategyTransformMapData; /* VARIABLE LENGTH STRUCTURE */ + +typedef StrategyTransformMapData *StrategyTransformMap; + +typedef struct StrategyOperatorData { + StrategyNumber strategy; + bits16 flags; /* scan qualification flags h/skey.h */ +} StrategyOperatorData; + +typedef StrategyOperatorData *StrategyOperator; + +typedef struct StrategyTermData { /* conjunctive term */ + uint16 degree; + StrategyOperatorData operatorData[1]; /* VARIABLE LENGTH */ +} StrategyTermData; /* VARIABLE LENGTH STRUCTURE */ + +typedef StrategyTermData *StrategyTerm; + +typedef struct StrategyExpressionData { /* disjunctive normal form */ + StrategyTerm term[1]; /* VARIABLE LENGTH ARRAY */ +} StrategyExpressionData; /* VARIABLE LENGTH STRUCTURE */ + +typedef StrategyExpressionData *StrategyExpression; + +typedef struct StrategyEvaluationData { + StrategyNumber maxStrategy; + StrategyTransformMap negateTransform; + StrategyTransformMap commuteTransform; + StrategyTransformMap negateCommuteTransform; + StrategyExpression expression[12]; /* XXX VARIABLE LENGTH */ +} StrategyEvaluationData; /* VARIABLE LENGTH STRUCTURE */ + +typedef StrategyEvaluationData *StrategyEvaluation; + +/* + * StrategyTransformMapIsValid -- + * Returns true iff strategy transformation map is valid. + */ +#define StrategyTransformMapIsValid(transform) PointerIsValid(transform) + + +#ifndef CorrectStrategies /* XXX this should be removable */ +#define AMStrategies(foo) 12 +#else /* !defined(CorrectStrategies) */ +#define AMStrategies(foo) (foo) +#endif /* !defined(CorrectStrategies) */ + +typedef struct StrategyMapData { + ScanKeyData entry[1]; /* VARIABLE LENGTH ARRAY */ +} StrategyMapData; /* VARIABLE LENGTH STRUCTURE */ + +typedef StrategyMapData *StrategyMap; + +typedef struct IndexStrategyData { + StrategyMapData strategyMapData[1]; /* VARIABLE LENGTH ARRAY */ +} IndexStrategyData; /* VARIABLE LENGTH STRUCTURE */ + +typedef IndexStrategyData *IndexStrategy; + +#endif /*STRAT_H */ |