计算Azure表存储中分区内的行 [英] Count rows within partition in Azure table storage

查看:85
本文介绍了计算Azure表存储中分区内的行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

关于SO如何获得Azure存储表的总计行计数,我已经看到了各种围绕SO的问题,但是我想知道如何获得单个分区中的行数./p>

在将最小数量的实体数据加载到内存中时,我该怎么做?

解决方案

您可能已经知道Azure表中没有可用的Count之类的功能.为了获取分区(或表)中实体(行)的总数,您必须获取所有实体.

您可以使用称为Query Projection的技术来减少响应负载.查询投影使您可以指定要表服务返回的实体属性(列)的列表.由于您只对实体的总数感兴趣,因此建议您仅取回PartitionKey.您可能会发现此博客文章对理解查询投影很有帮助: 解决方案

As you may already know that there's no Count like functionality available in Azure Tables. In order to get the total number of entities (rows) in a Partition (or a Table), you have to fetch all entities.

You can reduce the response payload by using a technique called Query Projection. A query projection allows you to specify the list of entity attributes (columns) that you want table service to return. Since you're only interested in total count of entities, I would recommend that you only fetch PartitionKey back. You may find this blog post helpful for understanding about Query Projection: https://blogs.msdn.microsoft.com/windowsazurestorage/2011/09/15/windows-azure-tables-introducing-upsert-and-query-projection/.

这篇关于计算Azure表存储中分区内的行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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