]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[5468] Added lease indexing by subnet identifiers and lease type.
authorMarcin Siodelski <marcin@isc.org>
Tue, 9 Jan 2018 14:47:10 +0000 (15:47 +0100)
committerMarcin Siodelski <marcin@isc.org>
Tue, 9 Jan 2018 14:47:10 +0000 (15:47 +0100)
src/share/database/scripts/mysql/dhcpdb_create.mysql
src/share/database/scripts/mysql/upgrade_5.1_to_6.0.sh.in
src/share/database/scripts/pgsql/dhcpdb_create.pgsql
src/share/database/scripts/pgsql/upgrade_3.2_to_4.0.sh.in

index 1f333b96b9c25f0cfcdb35405c0936e4dd87001c..b1cdd1d05883f60f2ee61d97db4bda20691afa3c 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2012-2017 Internet Systems Consortium, Inc. ("ISC")
+# Copyright (C) 2012-2018 Internet Systems Consortium, Inc. ("ISC")
 #
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -510,6 +510,12 @@ ALTER TABLE hosts ADD COLUMN user_context TEXT NULL;
 ALTER TABLE dhcp4_options ADD COLUMN user_context TEXT NULL;
 ALTER TABLE dhcp6_options ADD COLUMN user_context TEXT NULL;
 
+# Create index for searching leases by subnet identifier.
+CREATE INDEX lease4_by_subnet_id ON lease4 (subnet_id);
+
+# Create for searching leases by subnet identifier and lease type.
+CREATE INDEX lease6_by_subnet_id_lease_type ON lease6 (subnet_id, lease_type);
+
 # Update the schema version number
 UPDATE schema_version
 SET version = '6', minor = '0';
index c367165e42614efa1a5b1a59c0a55ba037c38f9d..c4e78091289abf4d3bffdbfb66c9e4f163fa5857 100644 (file)
@@ -24,6 +24,12 @@ ALTER TABLE hosts ADD COLUMN user_context TEXT NULL;
 ALTER TABLE dhcp4_options ADD COLUMN user_context TEXT NULL;
 ALTER TABLE dhcp6_options ADD COLUMN user_context TEXT NULL;
 
+# Create index for searching leases by subnet identifier.
+CREATE INDEX lease4_by_subnet_id ON lease4 (subnet_id);
+
+# Create for searching leases by subnet identifier and lease type.
+CREATE INDEX lease6_by_subnet_id_lease_type ON lease6 (subnet_id, lease_type);
+
 # Update the schema version number
 UPDATE schema_version
 SET version = '6', minor = '0';
index 0dedc8a6c3ca93b32588ea68d68dc7bbd564a612..90d1aed7da55cc0eb40bc9b00fe514009d4d0213 100644 (file)
@@ -1,4 +1,4 @@
--- Copyright (C) 2012-2017 Internet Systems Consortium, Inc. ("ISC")
+-- Copyright (C) 2012-2018 Internet Systems Consortium, Inc. ("ISC")
 
 -- This Source Code Form is subject to the terms of the Mozilla Public
 -- License, v. 2.0. If a copy of the MPL was not distributed with this
@@ -537,6 +537,12 @@ ALTER TABLE hosts ADD COLUMN user_context TEXT;
 ALTER TABLE dhcp4_options ADD COLUMN user_context TEXT;
 ALTER TABLE dhcp6_options ADD COLUMN user_context TEXT;
 
+-- Create index for searching leases by subnet identifier.
+CREATE INDEX lease4_by_subnet_id ON lease4 (subnet_id);
+
+-- Create for searching leases by subnet identifier and lease type.
+CREATE INDEX lease6_by_subnet_id_lease_type ON lease6 (subnet_id, lease_type);
+
 -- Set 4.0 schema version.
 UPDATE schema_version
     SET version = '4', minor = '0';
index c19bccbef4a75232b0f88a429d72a7e514dd26dc..c20e114f2a344cef067ff9a27b80439c4557d793 100644 (file)
@@ -26,6 +26,12 @@ ALTER TABLE hosts ADD COLUMN user_context TEXT;
 ALTER TABLE dhcp4_options ADD COLUMN user_context TEXT;
 ALTER TABLE dhcp6_options ADD COLUMN user_context TEXT;
 
+-- Create index for searching leases by subnet identifier.
+CREATE INDEX lease4_by_subnet_id ON lease4 (subnet_id);
+
+-- Create for searching leases by subnet identifier and lease type.
+CREATE INDEX lease6_by_subnet_id_lease_type ON lease6 (subnet_id, lease_type);
+
 -- Set 4.0 schema version.
 UPDATE schema_version
     SET version = '4', minor = '0';