Query OPENROWSET using serverless SQL pool in Azure Synapse Analytics Processed a large volume of data in 400000 Rows in simple count(*) on Cosmos DB linked

Santosh Kumar Singh 31 Reputation points
2022-10-04T12:30:54.737+00:00

Query OPENROWSET using serverless SQL pool in Azure Synapse Analytics Processed a large volume of data in 400000 Rows. I want to optimize the query, so as to handle high incurred costs.

Azure Synapse Analytics
Azure Synapse Analytics
An Azure analytics service that brings together data integration, enterprise data warehousing, and big data analytics. Previously known as Azure SQL Data Warehouse.
4,696 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Bhargava-MSFT 29,266 Reputation points Microsoft Employee
    2022-10-05T22:57:43.503+00:00

    Hello @Santosh Kumar Singh ,

    Welcome to the MS Q&A platform.

    In cosmos DB, the system function -count(scalar_expr) will benefit from a range Index for any properties in the query's filter.

    Below is the document explaining the include/exclude index strategy.

    https://learn.microsoft.com/en-us/azure/cosmos-db/index-policy#includeexclude-strategy

    I hope this helps. Please let me know if you have any further questions.