请教,关于PF中*REUSEDLT参数的使用
在做系统性能优化时,准备将部分主表PF的*REUSEDLT属性由修改为*YES状态,已经确认,程序运行上不会有问题,但性能上会不会有影响。
因为了解到这个参数是自动回收空间的,如果这样做后,会不会每次INSERT 或DELETE时,系统反应时间会增加,节了空间,增加了时间?
请赐教
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
写的性能会有轻微影响,程序要检查下,如果有逻辑处理隐含时间顺序依赖物理顺序的,顺序会有问题。
请问你说的被删除记录是如何被删除? 是指以前有被delet XXREC过的记录吗,还是其他的逻辑删除
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是什么意思?
我想知道准确的影响,比如1百成条记录,会影响多少秒之类的量化数据。
不知道有没有?
一般的情况下,对传统应用没有太大影响,但是对 reuse deleted record space,是有条件限制的。请参考IBM网站对此的文章,http://publib.boulder.ibm.com/in ... 0&pageDepth=%30
good luck!
PF文件的*REUSEDLT属性修改为*YES状态,并不表示自动回收空间. 而是表示到新加入记录时, 将会怎样动作.
如果*REUSEDLT为*NO的话,当新加入一条记录时, 总是加到文件尾部, RRN顺序加1, 定位不用花太多时间.
如果*REUSEDLT为*YES状态,当新加入一条记录时, 会先查询是否有已经标记为被删除的RRN, 如果有, 这条记录将重写查到的第一条被标记为删除的RRN. 如果没有查到任何被标记为删除记录的RRN, 新记录将被加入到文件尾部, RRN顺序加1. 这个过程会多浪费一点时间, 但这个时间基本可以忽略不计.
[ 本帖最后由 blogliou 于 2009-5-11 11:21 编辑 ]