john-bodley commented on code in PR #22413: URL: https://github.com/apache/superset/pull/22413#discussion_r1048009815
########## superset/connectors/sqla/models.py: ########## @@ -224,10 +224,10 @@ class TableColumn(Model, BaseColumn, CertificationMixin): __tablename__ = "table_columns" __table_args__ = (UniqueConstraint("table_id", "column_name"),) table_id = Column(Integer, ForeignKey("tables.id")) - table: SqlaTable = relationship( + table = relationship( "SqlaTable", - backref=backref("columns", cascade="all, delete-orphan"), - foreign_keys=[table_id], + back_populates="columns", + lazy="joined", # Eager loading for efficient parent referencing. Review Comment: The default is `lazy="select"` which results in lazy loading and [N +1](https://docs.sqlalchemy.org/en/14/glossary.html#term-N-plus-one-problem) `SELECT` statements. -- 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: notifications-unsubscr...@superset.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@superset.apache.org For additional commands, e-mail: notifications-h...@superset.apache.org