-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathTable.js
42 lines (40 loc) · 895 Bytes
/
Table.js
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
// Table is a table accessed by the query.
var Table = function(name, rows, accessType, key, possibleKeys, keyLength, ref, filtered) {
this.name = name;
this.rows = rows;
this.newRows = rows;
this.key = key;
this.possibleKeys = possibleKeys;
this.keyLength = keyLength;
this.ref = ref;
this.filtered = filtered;
var t = this;
this.setNewRows = function() {
if (this.value == "") {
t.newRows = 0;
return;
}
t.newRows = parseInt(this.value);
}
this.accessType = accessType;
switch (accessType) {
case "ALL":
this.scalability = "n";
break;
case "index":
this.scalability = "n";
break;
case "ref":
this.scalability = "log n";
break;
case "eq_ref":
this.scalability = "log n";
break;
case "const":
this.scalability = "1";
break;
default:
this.scalability = "?";
}
}
module.exports = Table;