Hi All,
In our database all the index and data tablespaces are LMT tablespaces. We are aware that the LMT tablespaces doesnt have fragmentation. But I have read some article, stating that the index objects will have holes while there are frequent deletions in data, and hence they are fragmented and the only way to correct them is to rebuild the indexes. Even the indexes are in the LMT this will happen.
So just correct me whether my understanding is correct or not.
As my indexes are in LMT, so if I rebuild them, will there be any use out of that?
well if you have holes then there are two possibilites
a)holes would be reused
suppose your application inserts data like a ,f,x,z and then you delete some entries say f and x .now you will have holes like this
a hole hole z however if the application again inserts b and c then these holes would be reused..somethin like a,b,c,z
b)holes will not be reused
suppose you have a order entry system where the orderid will be a ever increasing sequence number somethin like 1,2,3,4,5,6,7 now if you delete 2 ,3 ,4 ,5 and your application will now insert only 8 ,9,10 etc then you will have holes like this 1,hole,hole,hole,hole,6,7,8
so the answer to this question is really application dependent.
Hi,
LMT called as Locally Managed Tablespace is a new feature introduced from Oracle 8i.Basically prior to 8i the only tablespace that you can create was Dictionary managed which meant that any allocation or de-allocation of extents will be tracked by the data dictionary.In 8i the LMT will track the extent allocation and de-allocation by itself.Which means that in every datafile of the LMT tablespace ,there is a bitmap which keeps information about the extents in that datafile.So whenever an extent is allocated or de-allocated ,the bit in the bitmap will reflect the changes,so due to this the recursive calls on the data-dictionary is reduced.Also since LMT keeps track of the extents,the coalesing is done automatically.
Now regarding your question that your indexes and data is in LMT,indexes always have a high degree of fragmentation when your data is frequently deleted or updated or inserted in the table.So accordingly indexes will also take the changes.Whenever there are high deletions on the tables,the indexes will also have the effect of deletions because of which they become fragmented.
Eventhough u keep the indexes in the dictionary managed or LMT,the fragmentation of indexes will happen ,so you must rebuild your indexes when it becomes more fragmented.The kind of tablespace use to house the indexes will have a very little impact on the performance.
Originally posted by adewri No need to rebuild, the holes will get used when further inserts occur.
Not always. But holes are normally(?) not so important, the depth of the B-tree is more likely the reason to want to rebuild.
Rest in peace and let the indexes rest too.
Good advice - in most cases. (I bet there are more effective things that could be done to improve performance.)
(War story - index rebuild caused the biggest db trash ever I made - 7.3.4 with parallel option used a random number generator on them!)
"The power of instruction is seldom of much efficacy except in those happy dispositions where it is almost superfluous" - Gibbon, quoted by R.P.Feynman
I fully agree with you that those situations are rare..for me beleive it or not i have never rebuilt indexes even for once in my production databases..test yes but that was for different reasons all together
Bookmarks