Azure DocumentDB Query by Id is very slow

后端 未结 2 1732
小鲜肉
小鲜肉 2020-12-31 20:13

I got a 16GB collection with 2 partitions. When I query a document by it\'s Id, it is very slow. But querying by an indexed field is fast. Both are cross-partition query and

2条回答
  •  礼貌的吻别
    2020-12-31 20:33

    Microsoft support responded and they've resolved the issue. They've added IndexVersion 2 for the collection. Unfortunately, it is not yet available from the portal and newly created accounts/collection are still not using the new version. You'll have to contact Microsoft Support to made changes to your accounts.

    Here are the new results from a collection with index version 2 and there's a massive improvement.

    SELECT * FROM c where c.id = 'uniqueValue'
    -- Index Version 1: Request Charge: 344,940.79 RUs
    -- Index Version 2: Request Charge: 3.31 RUs
    
    SELECT * FROM c WHERE c.indexedField = 'value' AND c.id = 'uniqueValue'
    -- Index Version 1: Request Charge: 150,666.22 RUs 
    -- Index Version 2: Request Charge: 5.65 RUs
    

提交回复
热议问题