|
|
1.1 root 1: # include <tree.h>
2: # include <func.h>
3: # include <access.h>
4: # include "../decomp/decomp.h"
5: # include "../ovqp/ovqp.h"
6:
7: /* @(#)globs.h 7.3 3/7/81 */
8:
9:
10: struct agglist
11: {
12: QTREE **father; /* addr of pointer to you */
13: QTREE *agpoint; /* pointer to aghead */
14: QTREE *agfather; /* is your father an aggregate? */
15: short agvarno; /* var # assigned to aggr fnct */
16: };
17:
18: struct hitlist
19: {
20: QTREE **trepr; /* position in tree to be changed */
21: short byno; /* by-list position */
22: };
23:
24: struct rang_tab
25: {
26: int relnum; /* internal decomp relation number */
27: int rtspec; /* relspec of relation */
28: int rtstat; /* relstat of relation */
29: int rtwid; /* relwidth of relation */
30: long rtcnt; /* tupcount of relation */
31: int rtaltnum; /* reserved for distributed decomp */
32: char *rtattmap; /* reserved for distributed decomp */
33: long rtdcnt; /* reserved for distributed decomp */
34: struct d_range *rtsrange; /* reserved for distributed decomp */
35: };
36:
37:
38: /* The following structure reserved for distributed decomp */
39: /* The order of this has been changed for proper alignment */
40: struct d_range
41: {
42: int relnum;
43: int draltnum;
44: long drtupcnt;
45: struct d_range *drnext;
46: int drstat;
47: char drsite[2];
48: };
49:
50:
51: /* structure used by reduction to maintain component pieces */
52: struct complist
53: {
54: struct complist *nextcomp; /* next comp piece */
55: struct complist *linkcomp; /* next clause of this comp */
56: QTREE *clause; /* associated clause */
57: int bitmap; /* map of all assoc clauses */
58: };
59:
60: bool Batchupd;
61:
62: struct desc_tab
63: {
64: int relnum; /* relation number */
65: char dtmode; /* status of descriptor */
66: char dtpos; /* position of last access */
67: DESC desc; /* descriptor */
68: };
69:
70:
71: struct stacksym
72: {
73: char s_type;
74: char s_len;
75: long s_value[2];
76: }; /* stack for OVQP interpreter */
77:
78:
79: struct simp
80: {
81: int relop; /* value of relop in simp clause*/
82: int att; /* attno of attribute */
83: SYMBOL *const; /* pointer to constant value symbol */
84: };
85:
86:
87: struct key
88: {
89: SYMBOL *keysym;
90: int dnumber;
91: };
92:
93: extern int Equel;
94:
95: struct
96: {
97: /* OVQP variables */
98: char ov_outtup[MAXTUP];
99: char ov_intup[MAXTUP];
100: char *ov_origtup;
101: char *ov_tend; /* pts to end of data in ov_outtup */
102: short ov_bopen; /* TRUE if batch file is open */
103: short ov_targvc; /* var count in Target list (flags constant Targ. list) */
104: short ov_qualvc; /* var count in Qual list */
105: short ov_userqry; /* flags a query on the users's result rel */
106: short ov_retrieve; /* true is a retrieve, else false */
107: char *ov_ovqpbuf;
108: short ov_diffrel; /* true is ov_source and ov_result are different */
109: short ov_agcount; /* count of the # of aggregates in the query */
110: short ov_qvpointer;
111: long ov_intid;
112: long ov_uptid;
113: long *ov_counter; /* cnts "gets" done in OVQP */
114: long ov_lotid;
115: long ov_hitid; /* lo & hi limits of scan in OVQP */
116: long ov_tupsfound; /* counts # tuples which satified the query */
117: DESC *ov_scanr; /* pts to desc of reln to be scanned */
118: DESC *ov_source; /* 0 if no source for qry, else poshorts to ov_srcdesc */
119: DESC *ov_result; /* 0 if no result for qry, else poshorts to ov_reldesc */
120: SYMBOL **ov_tlist;
121: SYMBOL **ov_alist;
122: SYMBOL **ov_qlist;
123: SYMBOL **ov_bylist;
124: struct stacksym ov_stack[STACKSIZ];
125: char ov_keyl[MAXTUP];
126: char ov_keyh[MAXTUP];
127: int ov_nsimp; /* Current no. entries in ov_simp vector */
128: int ov_fmode; /* find-mode determined by strategy */
129: struct simp ov_simp[NSIMP];
130: struct key ov_lkey_struct[MAXDOM+1];
131: struct key ov_hkey_struct[MAXDOM+1];
132:
133: /* DECOMP/OVQP variables */
134:
135: struct agglist *de_aggnext; /* next in aggregate list */
136: struct agglist *de_agglim; /* limit in aggregate list */
137: struct hitlist *de_hnext;
138: struct hitlist *de_hlimit;
139: char de_d_dbu70;
140: char de_d_ovqp70;
141: int de_synconly;
142: int de_error_flag;
143: int de_qvptr; /* index into available de_qvect space in ovqpnod() */
144: SYMBOL *de_qvect[MAXNODES];
145: short de_newq; /* OVPQ must devise new strategy */
146: short de_newr; /* force OVQP to reopen result relation */
147: int de_qmode; /* flag set to indicate mode of tuple disposition */
148: int de_resultvar; /* if >= 0 result variable */
149: int de_sourcevar; /* likewise for source variable */
150: char *de_qbuf; /* pointer to query buffer */
151:
152:
153:
154: QTREE *de_qle; /* ptr to QLEND node */
155: QTREE *de_tr; /* ptr to TREE node */
156: int de_dfiles;
157: int de_dopnfiles;
158: struct desc_tab de_desc[MAXRELN]; /* descriptors available for use */
159: struct rang_tab de_rangev[MAXRANGE+2]; /* global range table with extra slot for FREEVAR and SECINDVAR */
160: int de_qry_mode; /* mode of original query (not nec same as de_qmode) */
161: char de_name_table[FIRSTNUM-1][MAXNAME];
162: char de_num_used[LASTNUM+1];
163: char de_buflag;
164: } De;
165:
166: short tTdecomp[100];
167: # ifdef tTf
168: # undef tTf
169: # endif tTf
170: # define tTf(a, b) ((b < 0) ? tTdecomp[a] : (tTdecomp[a] & (1 << b)))
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.