Teradata 中的调整(分组依据)

发布于 2024-12-06 20:45:10 字数 489 浏览 2 评论 0原文

我正在尝试调整 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

眼中杀气 2024-12-13 20:45:10

很难说任何事情,没有任何细节:

  • 查询(是否总是相同,或者总是有不同的 WHERE)
  • A 和 B 的结构(主索引/分区)
  • 执行计划
  • 执行日志(查看在哪里)但

如果我们假设这个单个查询每次在执行期间创建和使用 AJI 时都是完全相同的,那么我能想到的唯一改进就是尝试调整 JI 的主索引,因此它在 amp 之间的分布会尽可能统一

(顺便说一句,如果使用 AJI,那么步骤 2 和 4 将浪费您的时间和数据库空间)

It is very hard to say anything , without having any details about:

  • query (is it always they same, or there is always different WHERE )
  • structure of A and B (primary indexes/partitioning)
  • execution plan
  • log of execution (to see where is the bottleneck)

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)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文