0

Background: I have a C# project where I need to retrieve records based on the partition key and row key with a range from an Azure Table (that has more than 5,00,000 rows with multiple partition keys and the row key is a timestamp when this row is recorded).

I'm using ExecuteQuerySegmentedAsync with the table query as shown below under the code section.

Problem:

  1. The time it takes to get approx. 20k rows (with a specific partition key and row key range) is approx. 20 seconds. Can this be optimized?
  2. The time increases when I send multiple requests with different partition keys at the same time. It takes approx. 45 seconds - 1 minute for each request to complete to return approx 20k rows each. Why is this taking so long if I send multiple requests? Is there a different approach how to handle multiple requests or increase performance.?

Code:

tableQuery = PartitionKey eq '3dd373c2-dbf6-4d7a-81da-1ec69b652ca2' and RowKey le '2517379523999999999' and RowKey ge '2517367427999999999'

    do
    {
        tableRows = await table.ExecuteQuerySegmentedAsync(tableQuery, tableContinuationToken);
        rows.AddRange(tableRows.Results);
    
        tableContinuationToken = tableRows.ContinuationToken;
    
    
    } while (tableContinuationToken != null);
skdev
  • 1
  • 1
    Please edit your question and include the code for point #2 above. Basically show us how you are sending multiple requests. From the data it looks like your `RowKey` is reverse ticks (i.e. `DateTime.MaxValue.Ticks - some other date value`). Is that correct? – Gaurav Mantri Oct 15 '22 at 04:08
  • @GauravMantri yes the row key is DateTime.MaxValue.Ticks - DateTimewegetData.Ticks. And when I say multiple requests -> This is a Web API project and I'm sending requests using Postman to fetch data for different time periods. – skdev Oct 28 '22 at 22:32

0 Answers0