GutoVeronezi commented on PR #8737:
URL: https://github.com/apache/cloudstack/pull/8737#issuecomment-1995191529

   As proved by @JoaoJandre in comment 
https://github.com/apache/cloudstack/pull/8737#issuecomment-1992241242, the 
indiscriminate addition of an index for `timestamp` might cause more problems 
than benefits.
   
   >  I only noticed this after users complained that listing VMs when creating 
a port forwarding was taking >30 seconds to load
   
   @kohrar, the way to address an issue like this should use a more rational 
manner. For instance, if we ask ourselves why metrics storage are affecting the 
VM listing on the port forwarding view, we might see/look for a different 
solution. The port forwarding view is calling `listVirtualMachines`, which by 
default (honestly, I do not know why it does that when we have 
`listVirtualMachinesMetrics` and `listVirtualMachinesUsageHistory`) makes a 
join with the statistics table. The problem is that the API 
`listVirtualMachines` is not working in a optimized fashion (returning VM 
statistics by default), and the UI is not passing the parameter `details` to 
not list the statistics. Therefore, the problem in this view is not the lack of 
indexes; but the API working/being called in a non-optimized way. I already 
talked with @JoaoJandre to work on a patch for this situation.
   
   > Yes I think we can all agree that the big one here is index on vm_id.
   
   Indeed, the index for `vm_id` might be good to have; however, we need some 
more testing as well.
   
   > if it's so slow to delete that it is impossible to do so, or breaks 
something, then that needs to be resolved, maybe by batch deletion or something.
   
   @mlsorensen, you can check @JoaoJandre's PR #8740 regarding the batch 
deletion.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to