-
Notifications
You must be signed in to change notification settings - Fork 2
/
Optimizer.h
57 lines (43 loc) · 1.68 KB
/
Optimizer.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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef _OPTIMIZER_H_
#define _OPTIMISER_H_
#include "PlanCostEstimator.h"
#include "Debug.h"
#define KILO 1024
void initOptimizer (Query *Q);
void loadStatsHelper (char *filename);
void getOptimalPlanHelper (Query **Q);
void printAllEnumeratedSets(Query *Q); //aisha
void enumerateAllSets (Query *Q);
void printSets (Node *n, short slot);//aisha
void enumerateSets (Node *n, short slot);
void createSet (int size, CCond **new_set, CCond *list, CCond *elem);
void createCompactGraph_v2 (Query **Q);
void createCompactGraph (Query **Q);
void mergeCompactGraph (Query *Q);
Node **buildNewCompactGraph (Node *compactGraph[], int numJoinNodes,
int ndxOfRecipientNode, int ndxOfMergedNode);
void copyCompactGraph (Node **newCompactGraph[], Node *oriCompactGraph[],
int numJoinNodes, int ndxOfMergedNode);
void mergeCompactGraphRecuresively (Query *Q, Node *compactGraph[], int level, int ndx);
int isValidCompactPlan (Query *Q, Node *compactGraph[]);
void traverseMergedNodes (Node *node, Node *compactGraph[], int *mergedNodes);
void copyNeighbors (Neighbor **dest, Neighbor *src);
void findOptimalCompactGraph (Query *Q);
int getNextPlan ();
void computePlanCost ();
int isValidPlan (Query *Q);
void assignOptimalPlan (Query *Q);
void loadStats (char *filename);
void init (Query *Q);
void printAllSets ();
void printOptimalPlan ();
void printSet (CCond *set);
void printCompactGraph (Node *compactGraph[], int num_join_nodes);
void printNgbrs (Neighbor *neighbors);
void cleanDatastructures();
void updateCompactGraph (Query **Q);
void setOptimalPlan (Query **Q);
void estimatePlanCost (Query *Q);
void temp (Query *Q);
void calculateNetworkSpeed();
#endif