[ 
https://issues.apache.org/jira/browse/CLOUDSTACK-9340?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15270150#comment-15270150
 ] 

ASF GitHub Bot commented on CLOUDSTACK-9340:
--------------------------------------------

Github user koushik-das commented on a diff in the pull request:

    https://github.com/apache/cloudstack/pull/1466#discussion_r61992331
  
    --- Diff: setup/db/db/schema-481to490.sql ---
    @@ -413,3 +413,26 @@ VIEW `user_vm_view` AS
     
     -- Add cluster.storage.operations.exclude property
     INSERT INTO `cloud`.`configuration` (`category`, `instance`, `component`, 
`name`, `description`, `default_value`, `updated`, `scope`, `is_dynamic`) 
VALUES ('Advanced', 'DEFAULT', 'CapacityManager', 
'cluster.storage.operations.exclude', 'Exclude cluster from storage 
operations', 'false', now(), 'Cluster', '1');
    +
    +----- 3) Missing indexes (Add indexes to avoid full table scans)
    +ALTER TABLE `cloud`.`op_it_work` ADD INDEX `i_type_and_updated` (`type` 
ASC, `updated_at` ASC);
    +ALTER TABLE `cloud`.`vm_root_disk_tags` ADD INDEX `i_vm_id` (`vm_id` ASC);
    +ALTER TABLE `cloud`.`vm_compute_tags` ADD INDEX `i_vm_id` (`vm_id` ASC);
    +ALTER TABLE `cloud`.`vm_network_map` ADD INDEX `i_vm_id` (`vm_id` ASC);
    +ALTER TABLE `cloud`.`ssh_keypairs` ADD INDEX `i_public_key` (`public_key` 
ASC);
    --- End diff --
    
    The public_key field is varchar(5120) and creating an index on this is 
failing with error 
    Error Code: 1071. Specified key was too long; max key length is 767 bytes



> General DB Optimization
> -----------------------
>
>                 Key: CLOUDSTACK-9340
>                 URL: https://issues.apache.org/jira/browse/CLOUDSTACK-9340
>             Project: CloudStack
>          Issue Type: Improvement
>      Security Level: Public(Anyone can view this level - this is the 
> default.) 
>    Affects Versions: 4.9.0
>            Reporter: Nicolas Vazquez
>              Labels: database
>             Fix For: 4.9.0
>
>
> h2. General DB Optimization
> In some production environments there were being experimented delays in most 
> of the jobs. A search for DB optimization was taken and some deficiencies 
> were discovered, we can group them in 4 groups:
> * Incorrect PRIMARY key
> * Duplicate PRIMARY KEY
> * Missing indexes (Add indexes to avoid full table scans)
> * Some views query (Change view to improve account retrieval speed)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to