一张大表分区然后子分区还是几个较小的分区表?

发布于 2024-11-23 20:24:40 字数 329 浏览 2 评论 0原文

我目前有几个审核特定表数据的审核表。

例如 ATAB_AUDIT、BTAB_AUDIT 和 CTAB_AUDIT 分别审核 ATAB、BTAB 和 CTAB 中的插入、更新和删除。

这些审计表按年份分区。

由于这些审计表中的列是相同的(change_date、old_value、new_value 等),因此使用一个大型审计表会有好处,因此添加一列保存生成审计记录的表的名称 (table_name) 按 table_name 对其进行分区然后按年份细分?

数据库是Solaris 上的Oracle 11g。

为什么或为什么不这样做?

非常感谢。

I currently have several audit tables that audit specific tables data.

e.g. ATAB_AUDIT, BTAB_AUDIT and CTAB_AUDIT auditing inserts, updates and deletes from ATAB, BTAB and CTAB respectively.

These audit tables are partitioned by year.

As the columns in these audit tables are identical (change_date, old_value, new_value etc.) would it be beneficial to use one large audit table, add a column holding the name of the table that generated the audit record (table_name) partition it by table_name and then subpartition by year?

The database is Oracle 11g on Solaris.

Why or why not do this?

Many thanks in advance.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

暖树树初阳… 2024-11-30 20:24:40

我猜想这两种方法的性能特征都非常相似。我将仅根据您决定如何对数据进行建模来做出此决定;这就是您的应用程序希望与数据库交互的方式。我不认为你的分区策略会影响这个决定(至少在这个例子中)。

两种方法都是有效的,但有时人们会沉迷于单表方法,最终将所有数据放入一张大表中。这种(反)模式有一个名字,但我忘记了。

I would guess that performance characteristics would be quite similar with either approach. I would make this decision based solely on how you decide to model your data; that is how your application(s) wish to interact with the database. I don't think your partitioning strategy would affect this decision (at least in this example).

Both approaches are valid, but sometimes people get carried away with the single-table approach and end up putting all data in one big table. There's a name for this (anti)pattern but it slips my mind.

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