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( .join(
Product Product
) )
.options( # .options(
joinedload(MarketplaceProduct.product) # joinedload(MarketplaceProduct.product)
) # )
.where( .where(
MarketplaceProduct.marketplace_id == marketplace.id, MarketplaceProduct.marketplace_id == marketplace.id,
or_( or_(