Fragmented Tables [message #277373] |
Mon, 29 October 2007 16:22 |
rubhatta
Messages: 7 Registered: August 2007
|
Junior Member |
|
|
Hi All,
We are using Oracle database 10.2.0.3.0 and wanted to know whether reorganization of fragmented tables can lead to significant performance improvement.
Could you please tell me how I can find out the tables that are fragmented and thus candidates for reorg?
Also, what is the relation between the table extents and fragmentation? I see that the extents in dba_segments for some tables are well above 100. Should these tables be reorganized? If yes, is there a cut-off for the exents above which a table should be reorganized?
Looking forward to your replies. Any help would be highly appreciated.
Thanks.
|
|
|
|
Re: Fragmented Tables [message #277387 is a reply to message #277375] |
Mon, 29 October 2007 20:50 |
rleishman
Messages: 3728 Registered: October 2005 Location: Melbourne, Australia
|
Senior Member |
|
|
To add to that...
If you have a monolithic number of extents (say 1M), then it probably means you need a bigger extent size. Allocating a new extent when all others are full entails an overhead, and that overhead is pretty static no matter how big the extent.
So, when you perform a load of 1M rows and it allocates 100 new extents, then you are copping that overhead 100 times instead of (perhaps) once (or not at all).
Auto-extending files complicates it a bit further. But all of this just means that your INSERTs are slower, not your SELECTs.
Now, say you've got a number of tables with tens of thousands of extents. This means your data dictionary is REALLY big. What if it gets SO big that it can't fit into memory? You will get recursive SQL; that's SQL that Oracle performs to probe the data dictionary when it needs DD data that is not cached.
You can tell if you are getting recursive SQL by tracing a job and checking the footer of the TK*Prof output. Your first move would probably be to fiddle with initialisation parameters to increase the memory. If you discovered that it didn't help AND that there were some enormous DD tables due to many extents, THEN it would be time to reorg the tables in question into a tablespace with larger extents.
Ross Leishman
|
|
|