G
George Potemkin
Guest
Hi Piotr, The program was just recently created. Dmitri Levin and me will present it in Copenhagen. The programt successfully passed all my tests but I don't like to share it publicly before it will be tested on real databases. I will leave here just its description. Let me know if there are the volunteers who are ready to participate in the tests. So far the results are very promissory: record defragmentation may speed up the reads by a few times (and even more than ten times). The syntax: &SCOPED-DEFINE Use-RecCopy-DB FALSE &SCOPED-DEFINE Allow-Defrag {&Use-RecCopy-DB} RUN ScanArea({&Allow-Defrag}, AreaNumber, FromOrToBlock, NumOfBlocks). where RecCopy is an auxiliary database that you may use or not use during real defragmentation (see below), If Allow-Defrag is FALSE then procedure creates just a few reports: 1) The report that is similar to the tabanalys; 2) Size distribution for the scanned records and separately the size distribution for the found fragmented records; 3) Distribution of real RPB and distribution of slots used by fragmented records.I guess in your case (with small Create Limit) all fragmented records will be resided on largest slots in the data blocks. AreaNumber - which area to scan; FromOrToBlock - either first or last block to scan; NumOBlocks - if the value is greater than 0 then FromOrToBlock set a first block to begin the scanning. Otherwise FromOrToBlock is a last block, Examples: RUN ScanArea(FALSE, 7, 1, ?) - scan the whole area # 7 RUN ScanArea(FALSE, 7, 1, 10000) - scan the first 10000 blocks. RUN ScanArea(FALSE, 7, ?, -10000) - scan the last 10000 blocks (below HWM). If you will allow defragmentation then the fragmented records will be copied to the RecCopy table (real one or temp-table). When the program collects enough records (100 records by default) it will delete them all in one transaction) and re-create them all in another transaction. You can you use an extental database with the RecCopy table to protect your data against the lost during power failure and database crash between those two transactions. The chances of such events are, of course, negligibly low. Nevertheless you can use the protection. Use-RecCopy-DB FALSE means that program will use the RecCopy temp-table. In my tests the program processed approximately 300 blocks per sec. It's, of course, not fast compared with tabanalys. And speed might depend from area's RPB. On other hand, we can process the large areas in a few steps by specifying the ranges of the blocks to scan (simultaneously or sequentially). Best regards, George
Continue reading...
Continue reading...