mirror of
https://github.com/apache/cloudstack.git
synced 2025-10-26 08:42:29 +01:00
add index to speed up querying IPs in the network-tab (#7028)
* procedure to add index and add index * sloppy mistakes, thanks Wei Co-authored-by: Wei Zhou <weizhou@apache.org> Co-authored-by: Wei Zhou <weizhou@apache.org>
This commit is contained in:
parent
a9b49f3ae9
commit
af59e76df6
@ -869,3 +869,17 @@ WHERE usage_unit = 'Policy-Month';
|
||||
|
||||
-- delete configuration task.cleanup.retry.interval #6910
|
||||
DELETE FROM `cloud`.`configuration` WHERE name='task.cleanup.retry.interval';
|
||||
|
||||
--- #6888 add index to speed up querying IPs in the network-tab
|
||||
DROP PROCEDURE IF EXISTS `cloud`.`IDEMPOTENT_ADD_KEY`;
|
||||
|
||||
CREATE PROCEDURE `cloud`.`IDEMPOTENT_ADD_KEY` (
|
||||
IN in_index_name VARCHAR(200)
|
||||
, IN in_table_name VARCHAR(200)
|
||||
, IN in_key_definition VARCHAR(1000)
|
||||
)
|
||||
BEGIN
|
||||
|
||||
DECLARE CONTINUE HANDLER FOR 1061 BEGIN END; SET @ddl = CONCAT('ALTER TABLE ', in_table_name); SET @ddl = CONCAT(@ddl, ' ', ' ADD KEY ') ; SET @ddl = CONCAT(@ddl, ' ', in_index_name); SET @ddl = CONCAT(@ddl, ' ', in_key_definition); PREPARE stmt FROM @ddl; EXECUTE stmt; DEALLOCATE PREPARE stmt; END;
|
||||
|
||||
CALL `cloud`.`IDEMPOTENT_ADD_KEY`('i_user_ip_address_state','user_ip_address', '(state)');
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user