Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Sebastian Schrader
Kea
Commits
640d3538
Commit
640d3538
authored
Oct 15, 2015
by
Marcin Siodelski
Browse files
[3968] Added ASC sorting for indexes by expiration.
parent
e7fd02a5
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/bin/admin/scripts/mysql/dhcpdb_create.mysql
View file @
640d3538
...
...
@@ -265,8 +265,8 @@ ALTER TABLE lease6
# by the expiration time. One of the applications is to retrieve all
# expired leases. However, these indexes can be also used to retrieve
# leases in a given state regardless of the expiration time.
CREATE INDEX lease4_by_state_expire ON lease4 (state, expire);
CREATE INDEX lease6_by_state_expire ON lease6 (state, expire);
CREATE INDEX lease4_by_state_expire ON lease4 (state
ASC
, expire
ASC
);
CREATE INDEX lease6_by_state_expire ON lease6 (state
ASC
, expire
ASC
);
# Create table holding mapping of the lease states to their names.
# This is not used in queries from the DHCP server but rather in
...
...
src/bin/admin/scripts/mysql/upgrade_3.0_to_4.0.sh.in
View file @
640d3538
...
...
@@ -28,8 +28,8 @@ ALTER TABLE lease6
# by the expiration time. One of the applications is to retrieve all
# expired leases. However, these indexes can be also used to retrieve
# leases in a given state regardless of the expiration time.
CREATE INDEX lease4_by_state_expire ON lease4 (state, expire);
CREATE INDEX lease6_by_state_expire ON lease6 (state, expire);
CREATE INDEX lease4_by_state_expire ON lease4 (state
ASC
, expire
ASC
);
CREATE INDEX lease6_by_state_expire ON lease6 (state
ASC
, expire
ASC
);
# Create table holding mapping of the lease states to their names.
# This is not used in queries from the DHCP server but rather in
...
...
src/lib/dhcpsrv/mysql_lease_mgr.cc
View file @
640d3538
...
...
@@ -143,7 +143,7 @@ TaggedStatement tagged_statements[] = {
"state "
"FROM lease4 "
"WHERE state != ? AND expire < ? "
"ORDER BY expire "
"ORDER BY expire
ASC
"
"LIMIT ?"
},
{
MySqlLeaseMgr
::
GET_LEASE6_ADDR
,
"SELECT address, duid, valid_lifetime, "
...
...
@@ -182,7 +182,7 @@ TaggedStatement tagged_statements[] = {
"state "
"FROM lease6 "
"WHERE state != ? AND expire < ? "
"ORDER BY expire "
"ORDER BY expire
ASC
"
"LIMIT ?"
},
{
MySqlLeaseMgr
::
GET_VERSION
,
"SELECT version, minor FROM schema_version"
},
...
...
src/lib/dhcpsrv/tests/schema_mysql_copy.h
View file @
640d3538
...
...
@@ -220,8 +220,8 @@ const char* create_statement[] = {
"ALTER TABLE lease6 "
"ADD COLUMN state INT UNSIGNED DEFAULT 0"
,
"CREATE INDEX lease4_by_state_expire ON lease4 (state, expire)"
,
"CREATE INDEX lease6_by_state_expire ON lease6 (state, expire)"
,
"CREATE INDEX lease4_by_state_expire ON lease4 (state
ASC
, expire
ASC
)"
,
"CREATE INDEX lease6_by_state_expire ON lease6 (state
ASC
, expire
ASC
)"
,
// Production schema includes the lease_state table and
// lease_hwaddr_source tables which map to the values in lease4
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment