Teradata 中的调整(分组依据)
我正在尝试调整 Teradata 中的查询。它相当大,所以我在大纲下面给出:
SEL column_1, column_2......column_20, sum(column_21), sum(column_22),.....sum(column_30)
from table_a a
inner join table_b b
on conditions...
group by column_1, ...,column_20;
我正在尝试调整它。它在小组中遇到了性能障碍。表 A 和 B 非常巨大(超过 20 亿条记录)。
我尝试了以下选项,但没有一个提高了性能:
1) 收集了所有必要的统计信息
2) 在表 A 和 B 的列上创建了 JI
3) 在表 A 和 B 的列上创建了 AJI 以及求和
4 )在每个表上为 group by 涉及的列创建一个 SI。
有人可以建议如何进一步进行吗?
I am trying to tune a query in Teradata. It's pretty huge, so I am giving below the outline:
SEL column_1, column_2......column_20, sum(column_21), sum(column_22),.....sum(column_30)
from table_a a
inner join table_b b
on conditions...
group by column_1, ...,column_20;
I am trying to tune this. It's hitting a performance roadblock in the group by. The tables A and B are huge (more than 2 billion records).
I tried the following options, but none of them improved the performance:
1) Collected all necessary stats
2) Created a JI on the columns from table A and B
3) Created an AJI on the columns and the summations from table A and B
4) Created a SI on each of the tables for the columns involved in group by.
Can someone suggest how to proceed further?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
很难说任何事情,没有任何细节:
如果我们假设这个单个查询每次在执行期间创建和使用 AJI 时都是完全相同的,那么我能想到的唯一改进就是尝试调整 JI 的主索引,因此它在 amp 之间的分布会尽可能统一
(顺便说一句,如果使用 AJI,那么步骤 2 和 4 将浪费您的时间和数据库空间)
It is very hard to say anything , without having any details about:
But if we assume that this single query is exactly the same every time then AJI is created and used during execution, then then only improvement that I can think of would be trying to adjust primary index of JI, so its distribution among amp would be as uniform as possible
(BTW if AJI is used then steps 2 & 4 would be waste of your time and db space)