refactor: optimize is_master subquery using EXISTS instead of COUNT

This commit is contained in:
2025-07-04 14:45:07 +03:00
parent 9d2627932e
commit 2b6145f240

View File

@@ -265,9 +265,9 @@ async def get_stocks_data(
.join(
Product
)
.options(
joinedload(MarketplaceProduct.product)
)
# .options(
# joinedload(MarketplaceProduct.product)
# )
.where(
MarketplaceProduct.marketplace_id == marketplace.id,
or_(