You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/04/23 10:48:34 UTC

[GitHub] [incubator-superset] dpgaspar commented on a change in pull request #9619: [charts] Improve performance on GET list

dpgaspar commented on a change in pull request #9619:
URL: https://github.com/apache/incubator-superset/pull/9619#discussion_r413712679



##########
File path: superset/models/slice.py
##########
@@ -72,6 +72,15 @@ class Slice(
     perm = Column(String(1000))
     schema_perm = Column(String(1000))
     owners = relationship(security_manager.user_model, secondary=slice_user)
+    table = relationship(
+        "SqlaTable",
+        foreign_keys=[datasource_id],
+        primaryjoin="and_(Slice.datasource_id == SqlaTable.id, "
+        "Slice.datasource_type == 'table')",
+        remote_side="SqlaTable.id",
+        lazy="joined",
+    )

Review comment:
       Setting this relation will avoid making one extra query per row, but will not support showing the datasource for deprecated druid source (yet will issue an outer join)




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

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org