在Azure的表存储日期范围查询 [英] Date range queries in Azure Table storage
问题描述
您好从我以下的问题上:<一href=\"http://stackoverflow.com/questions/21149087/windows-azure-table-access-latency-partition-keys-and-row-keys-selection\">Windows Azure的表访问延迟分区键和行键选择了解的方式我在Azure存储帐户的组织的数据。我设计来存储实体信息表存储方案。
Hello following on from my question: Windows Azure table access latency Partition keys and row keys selection about the way I have organised data in my Azure storage account. I have a table storage scheme designed to store info about entities.
有大约4000 - 5000实体。有6个实体类型和类型都大致均匀地分布。所以各地800'ish每个
There are about 4000 - 5000 entities. There are 6 entity types and the types are roughly evenly distributed. so around 800'ish each.
ParitionKey:的EntityType-日期
ParitionKey: entityType-Date
行键:ENTITYID
Row key: entityId
由于这个问题的细节,我一直受着延迟问题在哪里查询为多个分区,似乎需要相当一段时间。
As the question details I have been sufferring latency issues where querying for multiple partitions seems to take quite a while.
从本质上一个可能的解决办法是做以下的查询:
Essentially one possible solution would be to do a query of the following:
PartitionKey>的EntityType-日期和PartitionKey&LT;的EntityType-HighDate和RowKey ='ENTITYID
PartitionKey > 'EntityType-Date' and PartitionKey < EntityType-HighDate' and RowKey = 'EntityId'
这似乎并不在窗口Azure存储资源管理工作。它似乎并不承认比不到,我想那种期待越大。
This does not seem to work in Window Azure Storage Explorer. It doesn't seem to recognize the greater than less than, which I'd kind of expect.
我的问题是究竟如何呢小于,工作更伟大,我会按表类型更好分裂我的实体了。因此,我的查询会是什么?或者我应该是在追求一种不同的方法?
My question is exactly how does less than, greater than work and would I be better splitting my entities out by table type. Thus my query would be? Or should I be pursuing a different approach?
PartitionKey> LowDate和PartitionKey&LT; HighDate和RowKey ='ENTITYID
PartitionKey > LowDate and PartitionKey < HighDate and RowKey = 'EntityId'
推荐答案
至于查询语法而言在Azure存储资源管理器中,你需要指定这样的查询:
As far as querying syntax is concerned in Azure Storage Explorer, you would need to specify your query like this:
(PartitionKey gt 'EntityType-Date' and PartitionKey lt EntityType-HighDate') and (RowKey eq 'EntityId')
请参阅以下链接了解详情:<一href=\"http://msdn.microsoft.com/en-us/library/windowsazure/dd894031.aspx\">http://msdn.microsoft.com/en-us/library/windowsazure/dd894031.aspx.
Please see this link for more details: http://msdn.microsoft.com/en-us/library/windowsazure/dd894031.aspx.
有关决定PartitionKey / RowKey高效查询,我会强烈建议阅读从存储团队这个博客:<一href=\"http://blogs.msdn.com/b/windowsazurestorage/archive/2010/11/06/how-to-get-most-out-of-windows-azure-tables.aspx\">http://blogs.msdn.com/b/windowsazurestorage/archive/2010/11/06/how-to-get-most-out-of-windows-azure-tables.aspx.
For deciding on PartitionKey/RowKey for efficient querying, I would strongly recommend reading up this blog from Storage team: http://blogs.msdn.com/b/windowsazurestorage/archive/2010/11/06/how-to-get-most-out-of-windows-azure-tables.aspx.
这篇关于在Azure的表存储日期范围查询的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!