db2 -extended_row_sz优点和缺点

发布于 2025-01-17 16:58:48 字数 264 浏览 3 评论 0 原文

您能帮助我了解使用 extended_row_sz 在DB2设置级别中使用的利弊吗?

我们只能为特定的表空间设置一些东西吗?

如果没有 extended_row_sz 启用启用设置,我们不允许我们创建一个总列大小超过32k的表,即我们不允许使用 varchar(5000) data类型创建。我们可以使用CLOB数据类型创建;但是,即使没有某个数据不存在,Clob也消耗了很多空间。

Can you help me understand the pros and cons of using extended_row_sz parameter in DB2 settings level?

Is that something can we set for a specific tablespace only?

Without extended_row_sz setting enabled we are not allowed to create a table with total column size more than 32K i.e. we are not allowed to create with VARCHAR(5000) data type. We can create using CLOB data type though; but CLOB is consuming lot of space even when sometime data is not there.

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

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

发布评论

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

评论(2

岁月静好 2025-01-24 16:58:48

Extended_row_sz 是针对不想花时间设计数据库以获得最佳性能的懒人。它旨在启用Oracle兼容性功能:Oracle数据库没有行尺寸限制,并且需要重写DDL的DDL,以使行大小超过页面大小确定的限制。启用扩展行尺寸后,One将能够按原样运行Oracle DDL语句。

但是,DB2中的行尺寸限制没有任何地方。启用扩展行大小后发生的事情是,如果表的总声明的行宽度超过了限制,则DB2将长字符列的数据类型隐式转换为clob。这样做的情况下,如果您要明确设计表以在必要时使用clobs(LOB内线和Lob tablespace属性),则可以在没有任何性能优化的情况下进行任何性能优化。

因此,要回答您有关 extended_row_sz 的优点和缺点的问题:它为您在数据库设计时间内节省了一些精力,以潜在的性能问题为代价,这不是很容易诊断,并且需要数据库重新设计无论如何,将来。

extended_row_sz is for lazy people who do not want to spend time designing their database for best performance. It was intended to enable the Oracle compatibility feature: the Oracle database does not have the row size limit and one would need to rewrite DDL for tables where row sizes exceeded the limit determined by the page size. After enabling the extended row size one would be able to run the Oracle DDL statements as is.

However, the row size limit in Db2 did not go anywhere. What happens after enabling the extended row size is that Db2 implicitly converts the data types of long character columns to CLOB if the total declared row width of a table exceeds the limit. It does so without telling you and without any performance optimisations that a careful DBA would be able to apply if they were to explicitly design tables to use CLOBs where necessary (LOB inlining and the LOB tablespace properties come to mind).

So, to answer your question about pros and cons of extended_row_sz: it saves you some effort at the database design time, at the cost of potential performance problems, which are not very easy to diagnose and require database redesign anyway, in the future.

花心好男孩 2025-01-24 16:58:48

Extended row size is an ability to bypass the Row Size Limit (it depends on a page size) for a given table.
Briefly: each table row in Db2 must physically reside in a single page. LOBs (not inlined) are not stored in that page physically, only pointers to them are stored on data pages. LOBs itself are stored in separate objects inside tablespaces.
Such an ability is turned on at the database (not at the table or tablespace) level.

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