Skip to content

Commit

Permalink
chore(sqla): Address performance tradeoff with eager loading (apache#…
Browse files Browse the repository at this point in the history
…23113)

(cherry picked from commit f851e99)
  • Loading branch information
john-bodley authored and sadpandajoe committed Feb 28, 2023
1 parent b11d669 commit 381d70f
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions superset/connectors/sqla/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,6 @@ class TableColumn(Model, BaseColumn, CertificationMixin):
table: Mapped["SqlaTable"] = relationship(
"SqlaTable",
back_populates="columns",
lazy="joined", # Eager loading for efficient parent referencing with selectin.
)
is_dttm = Column(Boolean, default=False)
expression = Column(MediumText())
Expand Down Expand Up @@ -449,7 +448,6 @@ class SqlMetric(Model, BaseMetric, CertificationMixin):
table: Mapped["SqlaTable"] = relationship(
"SqlaTable",
back_populates="metrics",
lazy="joined", # Eager loading for efficient parent referencing with selectin.
)
expression = Column(MediumText(), nullable=False)
extra = Column(Text)
Expand Down Expand Up @@ -551,13 +549,11 @@ class SqlaTable(Model, BaseDatasource): # pylint: disable=too-many-public-metho
TableColumn,
back_populates="table",
cascade="all, delete-orphan",
lazy="selectin", # Only non-eager loading that works with bidirectional joined.
)
metrics: Mapped[List[SqlMetric]] = relationship(
SqlMetric,
back_populates="table",
cascade="all, delete-orphan",
lazy="selectin", # Only non-eager loading that works with bidirectional joined.
)
metric_class = SqlMetric
column_class = TableColumn
Expand Down

0 comments on commit 381d70f

Please sign in to comment.