通过收集行键查询蔚蓝表 [英] Query azure table by collection of row keys

查看:189
本文介绍了通过收集行键查询蔚蓝表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要做一些实体通过收集排按键的样子了(在一个分区)。什么是正确的查询做呢?

I need to do a look up of several entities by collection of row keys (in one partition). What is the proper query to do it?

推荐答案

只有通过rowkey查询(我敢跨preting原来的问题被影射)问题:你最终做一个表扫描,因为这rowkey可能存在的任何分区。而且,如果你单独执行这些查询,你最终会做的每一个表扫描(即使有任务并行库,在注释原来的问题建议的@GlennFerrieLive)。

The issue with querying only by rowkey (which I'm interpreting the original question to be alluding to): You'll end up doing a table scan, as that rowkey could exist in any partition. And, if you executed those queries individually, you'd end up doing a table scan for each (even with Task Parallel Library, as suggested by @GlennFerrieLive in a comment to the original question).

您可以为rowkey与 $过滤器(如在的这篇文章),或离散行键的列表(仅限于15个单独的比较过滤器内)。这应该结束了只有一个表扫描,但仍...表扫描。

You could specify a range for the rowkey with $filter (as explained in this article), or a discrete list of row keys (limited to 15 individual comparisons within the filter). This should end up with just one table scan, but still... a table scan.

如果可能的话,指定在查询一个partitionkey,你应该这样做,因为这会使你的查询返回快得多。好吧,更快的是相对的,因为我不知道的数据要存储的数量。

If at all possible to specify a partitionkey in your query, you should do so, as it will make your queries return much faster. Ok, much faster is relative, as I have no idea of the quantity of data you're storing.

修改:每经评论更新,因为你知道partitionkey,可以按照上述规定在一个过滤器无论是rowkey范围或离散rowkeys指导。或...如果你有更多的rowkeys,你​​可以考虑通过TPL执行这些(使得现在给没有表扫描意义上的),无论是按过滤器单rowkey或分组到的范围或过滤列表。

EDIT: Per update via comment, since you know partitionkey, you could follow the guidance above specifying either a rowkey range or discrete rowkeys within a single filter. Or... if you have many more rowkeys, you could consider execute these via TPL (which now makes sense given there's no table scan), either as single rowkey per filter or grouping into ranges or filtered list.

这篇关于通过收集行键查询蔚蓝表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆