MCPcopy Create free account
hub / github.com/anse1/sqlsmith / generate_indexes

Method generate_indexes

schema.cc:11–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9using namespace pqxx;
10
11void schema::generate_indexes() {
12
13 cerr << "Generating indexes...";
14
15 for (auto &type: types) {
16 assert(type);
17 for(auto &r: aggregates) {
18 if (type->consistent(r.restype))
19 aggregates_returning_type[type].push_back(&r);
20 }
21
22 for(auto &r: routines) {
23 if (!type->consistent(r.restype))
24 continue;
25 routines_returning_type[type].push_back(&r);
26 if(!r.argtypes.size())
27 parameterless_routines_returning_type[type].push_back(&r);
28 }
29
30 for (auto &t: tables) {
31 for (auto &c: t.columns()) {
32 if (type->consistent(c.type)) {
33 tables_with_columns_of_type[type].push_back(&t);
34 break;
35 }
36 }
37 }
38
39 for (auto &concrete: types) {
40 if (type->consistent(concrete))
41 concrete_type[type].push_back(concrete);
42 }
43
44 for (auto &o: operators) {
45 if (type->consistent(o.result))
46 operators_returning_type[type].push_back(&o);
47 }
48 }
49
50 for (auto &t: tables) {
51 if (t.is_base_table)
52 base_tables.push_back(&t);
53 }
54
55 cerr << "done." << endl;
56
57 assert(booltype);
58 assert(inttype);
59 assert(internaltype);
60 assert(arraytype);
61
62}

Callers

nothing calls this directly

Calls 1

consistentMethod · 0.45

Tested by

no test coverage detected