Sahar, January 23, 2017 - 8:40 pm UTC
Thanks. If the database is using ASSM isn't better to use SHRINK as opposed to MOVE since SHRINK rebuilds the indexes as well?
Also you mentioned a good point. How do we really know if shrinking the segment (releasing HWM) is going to be worthy? Is it going to help the database performance?
Thanks,
Sahar
January 24, 2017 - 12:48 am UTC
SHRINK does *not* "rebuild" anything - it simply shifts rows about to fill in 'gaps' so that the high water mark can be moved. Its roughly equivalent to doing a series of deletes/inserts, which is why the indexes dont need to be rebuilt.
MOVE is more "dramatic" - its like a unload/reload of the data, and hence a full rebuild of the indexes is needed.
re: "How do we really know if shrinking the segment (releasing HWM) is going to be worthy?"
If you have lots of queries that do full scans, then a 'lower' HWM should assist them. If all of your access is index lookups, then performance benefits would be expected to be smaller (if any)
Sahar, January 24, 2017 - 3:59 pm UTC