mistercrunch commented on code in PR #31332:
URL: https://github.com/apache/superset/pull/31332#discussion_r1874563617


##########
superset/migrations/shared/security_converge.py:
##########
@@ -94,7 +95,10 @@ def __repr__(self) -> str:
 
 class PermissionView(Base):  # type: ignore
     __tablename__ = "ab_permission_view"
-    __table_args__ = (UniqueConstraint("permission_id", "view_menu_id"),)
+    __table_args__ = (
+        sqla.Index("idx_permission_view_menu_id", "view_menu_id"),
+        sqla.Index("idx_permission_permission_id", "permission_id"),

Review Comment:
   haven't looked at the queries against that table, but could be that a 
compound index work well here. I saw some queries that predicate on 
`view_menu_id` and some on both `view_menu_id` and `permission_id`. If 
permission is never predicated by itself, the compound on `view_menu_id` and 
`permission_id` (in that order) would cover those



-- 
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]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to