|
Post by account_disabled on Jan 11, 2024 6:50:13 GMT
我们最近遇到的一个问题是根据国家 地区分隔 表中的行。 是基于列存储的。 不是将整个记录存储在单个卷上,而是根据列值拆分行,并将每个值存储在自己的存储卷中。为了利用该方案,我们设计了一种高效、低成本的搜索解决方案来检索每个国家 地区的值,如下所述。 问题:按国家 地区隔离 表的 简单方法 要按国家 地区隔离 表,我们必须查询该表,次数与国家 地区的数量相同。 假设我们需要查询 、 、 、 和 列,每列大小为 ,我们的表的计费字节数将为。 如果我们需要运行查询的次数与国家 地区数量(即 个)一样多,则数将 巴西电话号码数据 是 或几乎 。假设 的费用为 美元,那么 表的总成本为 美元。 优化的方式 这里的技巧是将所需数量的字段分组为单个列。仅此一项不会记录所收取的字节数。第二个技巧是通过隔离柱进行旋转;在这种情况下,它将按国家 地区划分。 完成上述步骤后,我们的结果表将包含与国家 地区一样多的列。每列代表一个国家 地区的数据,并且仅包含该国家 地区之前分组的数据。 在我们的 表中,我们可以假设一个可能的结果,因为代表我们的列是 ,前 个国家 地区的平均容量约为 ,其余 个国家 地区的平均容量约为 。 现在,我们的计费字节基于每个国家 地区的数据大小。查询我们的计费成本仅为 美元,大国的成本为每个 美元,而其他国家的成本则远小于此。 分组表的总计费字节为 ,所有国家 地区的查询总计费字节为 。总成本约为 美元! 生成分组表 我们可以使用 将所需的列分组为单个列。我们可以以表示 文件或有效 对象中的行的格式创建一行。
|
|