sureshanaparti commented on code in PR #9401:
URL: https://github.com/apache/cloudstack/pull/9401#discussion_r3948428180


##########
engine/schema/src/main/resources/META-INF/db/views/cloud.host_view.sql:
##########
@@ -111,8 +110,9 @@ FROM
     `cloud`.`ha_config` ON ha_config.resource_id=host.id
         and ha_config.resource_type='Host'
         LEFT JOIN
-    `cloud`.`last_annotation_view` ON `last_annotation_view`.`entity_uuid` = 
`host`.`uuid`
+    (SELECT `annotations`.`entity_uuid`, `annotations`.`user_uuid`, 
MAX(`annotations`.`created`) AS created, `annotations`.`annotation`
+    FROM `cloud`.`annotations` WHERE `annotations`.`removed` IS NULL GROUP BY 
`annotations`.`entity_uuid`) AS last_annotated ON last_annotated.entity_uuid = 
host.uuid
         LEFT JOIN
-    `cloud`.`user` ON `user`.`uuid` = `last_annotation_view`.`user_uuid`
+    `cloud`.`user` ON `user`.`uuid` = last_annotated.user_uuid

Review Comment:
   hi @KlausDornsbach last_annotation_view maynot be required now, can we 
remove this view file 
engine/schema/src/main/resources/META-INF/db/views/cloud.last_annotation_view.sql?
 otherwise, the view will be created and unused.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to