-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathquery.h
38 lines (31 loc) · 1.05 KB
/
query.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
// query.h ... interface to query scan functions
// part of signature indexed files
// See query.c for details of Query type and functions
// Written by John Shepherd, March 2019
#ifndef QUERY_H
#define QUERY_H 1
#include "reln.h"
#include "tuple.h"
#include "bits.h"
// A suggestion ... you can change however you like
typedef struct _QueryRep {
// static info
Reln rel; // need to remember Relation info
char *qstring; // query string
//dynamic info
Bits pages; // list of pages to examine
PageID curpage; // current page in scan
Count curtup; // current tuple within page
// statistics info
Count nsigs; // how many signatures read
Count nsigpages; // how many signature pages read
Count ntuples; // how many tuples examined
Count ntuppages; // how many data pages read
Count nfalse; // how many pages had no matching tuples
} QueryRep;
typedef struct _QueryRep *Query;
Query startQuery(Reln, char *, char);
void scanAndDisplayMatchingTuples(Query);
void queryStats(Query);
void closeQuery(Query);
#endif