<p>对我来说,这里的答案似乎是,在表存储上执行查询并没有像您预期的那样优化为使用OR运算符。当查询将点查询与<code>OR</code>运算符组合时,它不作为点查询处理。在</p>
<p>这可以在python、C和azurestorageexplorer中重现,在这些浏览器中,如果您将点查询与<code>OR</code>结合起来,则会比只返回一行的单独点查询慢10倍(甚至更多)。在</p>
<p>因此,获得具有分区键和行键的行数的最有效方法是使用<code>TableOperation.Retrieve</code>(在C中)进行单独的异步查询。使用<code>TableQuery</code>是非常低效的,并且不会产生任何接近Azure表存储的性能可伸缩性目标的结果。可伸缩性目标例如:“单个表分区(1kib实体)的目标吞吐量高达每秒2000个实体”。在这里,我甚至不能以每秒5行的速度提供服务,尽管所有的行都在不同的分区中。在</p>
<p>在任何文档或性能优化指南中,查询性能的这一限制都没有明确说明,但可以从<a href="https://docs.microsoft.com/fi-fi/azure/storage/common/storage-performance-checklist#querying" rel="nofollow noreferrer">Azure storage performance checklist</a>中的这些行中了解到:</p>
<blockquote>
<p>Querying</p>
<p>This section describes proven practices for querying the table service.</p>
<p>Query scope</p>
<p>There are several ways to specify the range of entities to query. The following is a discussion of the uses of each.</p>
<p>In general, avoid scans (queries larger than a single entity), but if you must scan, try to organize your data so that your scans retrieve the data you need without scanning or returning significant amounts of entities you don't need.</p>
<p>Point queries</p>
<p>A point query retrieves exactly one entity. It does this by specifying both the partition key and row key of the entity to retrieve. These queries are efficient, and you should use them wherever possible.</p>
<p>Partition queries</p>
<p>A partition query is a query that retrieves a set of data that shares a common partition key. Typically, the query specifies a range of row key values or a range of values for some entity property in addition to a partition key. These are less efficient than point queries, and should be used sparingly.</p>
<p>Table queries</p>
<p>A table query is a query that retrieves a set of entities that does not share a common partition key. These queries are not efficient and you should avoid them if possible.</p>
</blockquote>
<p>所以“一个点查询只检索一个实体”和“尽可能使用点查询”。因为我已经将数据拆分为分区,所以它可能被当作表查询来处理:“表查询是检索不共享公共分区键的一组实体的查询”。尽管查询组合了一组点查询,因为它列出了所有预期实体的分区键和行键。但是,由于组合查询不是只检索一个查询,所以不能期望它作为点查询(或点查询集)执行。在</p>