information about indexes [message #164545] |
Thu, 23 March 2006 22:48 |
kinjal
Messages: 124 Registered: June 2001
|
Senior Member |
|
|
Hello,
Where can I find the information about whether the index on particular table is rebuil or not. And if its rebuild then when it was rebuilt?
Kinjal
|
|
|
|
|
Re: information about indexes [message #164573 is a reply to message #164567] |
Fri, 24 March 2006 00:51 |
rleishman
Messages: 3728 Registered: October 2005 Location: Melbourne, Australia
|
Senior Member |
|
|
Didn't read the whole thread, but I got the gist.
My 2c:
My only criteria for rebuild is when the index is sparse - most blocks are less than half full.
Any INSERT could cause another row to be inserted in a nearly full index block. This will cause the block to split - the two blocks will only be half full. It is normal and no cause for alarm. These blocks will fill with further inserts, and the process repeats. If INSERTs are all that happen, you should never need to rebuild.
If the indexed column is correlated with the course of time (eg. a number allocated from a sequence), then inserts tend to go at the end giving you a nice dense block utilisation with no splitting.
Any update on a non-indexed column does not affect the index. Surprise, surprise!
Deletes leave holes in indexes, but these tend to be filled back up with new inserts later on. High volume deletes can leave an index sparse. Most people actually notice that FTS is slower because of the HWM problem before they notice any problem with the index.
I say rebuild/shrink both table and index after a big delete.
Updates on indexed columns are the killer. Once again, low volume is no problem. Unlike high volume deletes, people don't think twice about high volume updates. Huge amounts of data can be migrated from one part of the index to another, leaving paddocks of blank space along the way.
I've had some indexes that are about 10x bigger than they need to be because rows are continually migrated in the index and the holes are not refilled.
So my rule: anyting with a lot of deletes or updates on indexed columns (Fast Refresh Materialized Views especially!), you need to watch out for low block-utilisation.
I wrote a SQL to find them and posted it here.
_____________
Ross Leishman
|
|
|
|
Re: information about indexes [message #164597 is a reply to message #164591] |
Fri, 24 March 2006 04:22 |
tarundua
Messages: 1080 Registered: June 2005 Location: India
|
Senior Member |
|
|
Mahesh and Ross,
Thanks to you both. Why i asked this because in my new job they are rebuilding indexes on a scheduled day ?
So just being curious i raised this question. I will dig deeper into the scripts that they use for selecting the indexes that are suppose to be rebuild. And then i will come back if there is any doubt in my mind.
Thanks again,
Tarun
|
|
|
|
|