我们使用datetime作为行键,为了获得最新的条目,我们检索了一天的所有内容,然后用代码对其进行排序。
PartitionKey eq '123456' and RowKey ge '20170713000000000' and RowKey le '20170714000000000'
这会更快地从表存储中检索记录吗?
PartitionKey eq '123456' and RowKey eq '20170713101000000'
PartitionKey eq“123456”和RowKey eq“20170713101000000”
PartitionKey eq“123456”和RowKey ge“201707130000000000”和RowKey le“20170714000000000”
第一个查询使用了所有可用的索引( PartitionKey RowKey
PartitionKey
RowKey
第二个查询也很有效(虽然不如第一个查询有效),因为它只在单个分区中搜索,但它正在执行所谓的 Partition Scan 。此查询将转到所需的分区,然后执行匹配搜索 RowKey公司
Partition Scan
RowKey公司