-
Notifications
You must be signed in to change notification settings - Fork 0
/
NOTES
executable file
·46 lines (28 loc) · 972 Bytes
/
NOTES
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
User:
dnsquery
Database:
dns_latency_archive
Tables:
top_domains
-----------
CREATE TABLE IF NOT EXISTS top_domains ( id MEDIUMINT NOT NULL AUTO_INCREMENT, rank INT NOT NULL, domain TEXT NOT NULL, PRIMARY KEY (id) );
INSERT INTO top_domains (rank, domain) VALUES(1,'google.com'),(2,'facebook.com'),(3,'youtube.com'),(4,'yahoo.com'),(5,'live.com'),(6,'wikipedia.org'),(7,'baidu.com'),(8,'blogger.com'),(9,'msn.com'), (10,'qq.com');
CREATE TABLE IF NOT EXISTS domain_stats(
domain_id MEDIUMINT NOT NULL,
latency_avg FLOAT,
latency_stdev FLOAT,
num_succ_queries INT,
first_ts timestamp NOT NULL,
last_ts timestamp NOT NULL,
PRIMARY KEY (domain_id),
FOREIGN KEY (domain_id) REFERENCES top_domains(id)
);
CREATE TABLE IF NOT EXISTS dns_queries(
id MEDIUMINT NOT NULL AUTO_INCREMENT,
domain_id MEDIUMINT NOT NULL,
latency FLOAT,
ts timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (id),
FOREIGN KEY (domain_id) REFERENCES top_domains(id)
);
-----