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
  • Loading branch information
john-bodley authored Feb 17, 2023
1 parent 22a6487 commit f851e99
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 f851e99

Please sign in to comment.