为什么没有记录匹配标准时继续?

时间:2013-10-02 15:24:03

标签: azure-table-storage

假设继续partionkey和rowkey的存在表明有更多记录可用且没有延续表明没有更多记录是否合理?

我问的原因是因为以下查询根本没有返回任何记录(由于过滤条件),但仍然会返回继续。我很困惑,在查询表存储时我怎么知道是否有更多的记录?

var query = (from s in myStorageServiceContext.CreateQuery<Customer>("Customers")
             where false
             select s).Take(1000) as DataServiceQuery<Customer>;

var response = (QueryOperationResponse)query.Execute();

string nextRowKey = null;
string nextPartitionKey = null;
response.Headers.TryGetValue("x-ms-continuation-NextPartitionKey", out nextPartitionKey);
response.Headers.TryGetValue("x-ms-continuation-NextRowKey", out nextRowKey);

if (!string.IsNullOrEmpty(nextPartitionKey)) throw new Exception("NextPartitionKey is not null");
if (!string.IsNullOrEmpty(nextRowKey)) throw new Exception("NextRowKey is not null");

1 个答案:

答案 0 :(得分:0)

是的,没有继续表示没有更多记录。

在以下情况下,继续令牌会返回:

  1. 如果要退回的实体数量超过1,000个。
  2. 如果超出服务器超时间隔
  3. 如果查询跨越分区边界
  4. 有关详细信息,请参阅此link

    希望这有帮助。

    谢谢,

    KK

相关问题