免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 4310 | 回复: 6
打印 上一主题 下一主题

请教,关于PF中*REUSEDLT参数的使用 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2009-04-20 21:26 |只看该作者 |倒序浏览
5可用积分
在做系统性能优化时,准备将部分主表PF的*REUSEDLT属性由修改为*YES状态,已经确认,程序运行上不会有问题,但性能上会不会有影响。

因为了解到这个参数是自动回收空间的,如果这样做后,会不会每次INSERT 或DELETE时,系统反应时间会增加,节了空间,增加了时间?

请赐教

最佳答案

查看完整内容

PF文件的*REUSEDLT属性修改为*YES状态,并不表示自动回收空间. 而是表示到新加入记录时, 将会怎样动作.如果*REUSEDLT为*NO的话,当新加入一条记录时, 总是加到文件尾部, RRN顺序加1, 定位不用花太多时间.如果*REUSEDLT为*YES状态,当新加入一条记录时, 会先查询是否有已经标记为被删除的RRN, 如果有, 这条记录将重写查到的第一条被标记为删除的RRN. 如果没有查到任何被标记为删除记录的RRN, 新记录将被加入到文件尾部, RRN顺序加1. ...

论坛徽章:
0
2 [报告]
发表于 2009-04-20 21:26 |只看该作者
PF文件的*REUSEDLT属性修改为*YES状态,并不表示自动回收空间. 而是表示到新加入记录时, 将会怎样动作.

如果*REUSEDLT为*NO的话,当新加入一条记录时, 总是加到文件尾部, RRN顺序加1, 定位不用花太多时间.

如果*REUSEDLT为*YES状态,当新加入一条记录时, 会先查询是否有已经标记为被删除的RRN, 如果有, 这条记录将重写查到的第一条被标记为删除的RRN. 如果没有查到任何被标记为删除记录的RRN, 新记录将被加入到文件尾部, RRN顺序加1. 这个过程会多浪费一点时间, 但这个时间基本可以忽略不计.

[ 本帖最后由 blogliou 于 2009-5-11 11:21 编辑 ]

论坛徽章:
0
3 [报告]
发表于 2009-04-20 22:15 |只看该作者
一般的情况下,对传统应用没有太大影响,但是对 reuse deleted record space,是有条件限制的。请参考IBM网站对此的文章,http://publib.boulder.ibm.com/in ... 0&pageDepth=%30

good luck!

论坛徽章:
0
4 [报告]
发表于 2009-05-04 12:18 |只看该作者
我想知道准确的影响,比如1百成条记录,会影响多少秒之类的量化数据。
不知道有没有?

论坛徽章:
0
5 [报告]
发表于 2009-05-04 13:00 |只看该作者
Reusing deleted records

Sometimes you might want to reuse deleted records for your database files. In this case, you can use the REUSEDLT parameter.

When you specify REUSEDLT(*YES) on the Create Physical File (CRTPF) or Change Physical File (CHGPF) command, the following operations might work differently:
Arrival order becomes meaningless for a file that reuses deleted record space. Records might not be added at the end of the file.
End-of-file delay does not work for the files that reuse deleted record space.
One hundred percent reuse of deleted record space is not guaranteed. A file full condition might be reached or the file might be extended even though deleted record space still exists in the file.
Note: Because of the way the system reuses deleted record space, the following types of files should not be created or changed to reuse deleted record space:
Files processed using relative record numbers, and files used by an application to determine a relative record number that is used as a key into another file
Files used as queues
Any files used by applications that assume new record insertions are at the end of the file
When DB2® Symmetric Multiprocessing is installed, files on which you expect to have parallel index maintenance performed when rows are updated, inserted, or deleted
If you decide to change an existing physical file to reuse deleted record space, and there are logical files with access paths with first-in-first-out (FIFO) or last-in-first-out (LIFO) duplicate key ordering over the physical file, you can re-create the logical files without the FIFO or LIFO attribute and avoid rebuilding the existing access path by following these steps:

Rename the existing logical file that has the FIFO or LIFO attribute.
Create a second logical file identical to the renamed file except that duplicate key ordering should not be specified for the file. Give the new file the original file name. The new file shares the access path of the renamed file.
Delete the renamed file.


---------------------------------
End-of-file delay does not work for the files that reuse deleted record space.
这里的End-of-file delay是什么意思?

论坛徽章:
0
6 [报告]
发表于 2009-05-12 08:33 |只看该作者

回复 #5 blogliou 的帖子

请问你说的被删除记录是如何被删除? 是指以前有被delet XXREC过的记录吗,还是其他的逻辑删除

论坛徽章:
1
荣誉版主
日期:2011-11-23 16:44:17
7 [报告]
发表于 2009-05-14 14:02 |只看该作者
写的性能会有轻微影响,程序要检查下,如果有逻辑处理隐含时间顺序依赖物理顺序的,顺序会有问题。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP