Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(754)

Side by Side Diff: go/src/infra/crimson/sql/schema.sql

Issue 2113523005: Crimson: Added SQL indexes (Closed) Base URL: https://chromium.googlesource.com/infra/infra.git@crimson-add-host
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 -- Copyright 2016 The Chromium Authors. All Rights Reserved. 1 -- Copyright 2016 The Chromium Authors. All Rights Reserved.
2 -- 2 --
3 -- Use of this source code is governed by a BSD-style 3 -- Use of this source code is governed by a BSD-style
4 -- license that can be found in the LICENSE file or at 4 -- license that can be found in the LICENSE file or at
5 -- https://developers.google.com/open-source/licenses/bsd 5 -- https://developers.google.com/open-source/licenses/bsd
6 6
7 -- Create tables in the crimson DB. 7 -- Create tables in the crimson DB.
8 8
9 CREATE TABLE ip_range ( 9 CREATE TABLE ip_range (
10 site varchar(20) NOT NULL, 10 site varchar(20) NOT NULL,
sheyang 2016/07/01 21:55:26 Is this a PK?
pgervais 2016/07/01 22:26:36 It will be part of it (in another CL).
11 vlan varchar(20), 11 vlan varchar(20),
12 start_ip varchar(34) NOT NULL, 12 start_ip varchar(34) NOT NULL,
13 end_ip varchar(34) NOT NULL 13 end_ip varchar(34) NOT NULL
14 ) ENGINE=INNODB; 14 ) ENGINE=INNODB;
15 15
16 CREATE index ip_range_start_ip_idx ON ip_range(start_ip);
sheyang 2016/07/01 21:55:26 The purpose of index start_ip and end_ip is for qu
pgervais 2016/07/01 22:26:36 That's correct.
17 CREATE index ip_ragne_start_ip_idx ON ip_range(end_ip);
18
16 CREATE TABLE host ( 19 CREATE TABLE host (
17 site varchar(20) NOT NULL, 20 site varchar(20) NOT NULL,
sheyang 2016/07/01 21:55:26 Is this a FK?
pgervais 2016/07/01 22:26:36 It looks like a foreign key but it's not. There is
18 hostname varchar(63) NOT NULL, 21 hostname varchar(63) NOT NULL,
19 mac_addr varchar(14) NOT NULL, 22 mac_addr varchar(14) NOT NULL,
20 ip varchar(34) NOT NULL, 23 ip varchar(34) NOT NULL,
21 boot_class varchar(20), 24 boot_class varchar(20),
22 PRIMARY KEY (mac_addr) 25 PRIMARY KEY (mac_addr)
23 ) ENGINE=INNODB; 26 ) ENGINE=INNODB;
27
28 CREATE index host_site_hostname_idx ON host(site, hostname);
29 CREATE index host_site_ip_idx ON host(site, ip);
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698