Home » RDBMS Server » Performance Tuning » Oracle Coalesce vs Index Rebuild (10g(10.2.0.4))
Oracle Coalesce vs Index Rebuild [message #487687] Thu, 30 December 2010 01:11 Go to next message
paradoxkhan
Messages: 92
Registered: April 2008
Location: Pakistan
Member
Hello,

We have large tables 60-70 GB having 120 million records. We have
to perform index rebuild frequently which takes significant time to complete and effects database performance too.
Please tell me how we can use index Coalesce? what are its benefits, coalesce results in performance gain?

Thanks
Yasir Aftab
Re: Oracle Coalesce vs Index Rebuild [message #487691 is a reply to message #487687] Thu, 30 December 2010 01:33 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
We have to perform index rebuild frequently

Why?

Regards
Michel
Re: Oracle Coalesce vs Index Rebuild [message #487695 is a reply to message #487691] Thu, 30 December 2010 02:08 Go to previous messageGo to next message
knight
Messages: 111
Registered: January 2009
Senior Member
michel is saying that it should not be a periodically scheduled activity ,without any valid reason

excellent explaination here:

http://asktom.oracle.com/pls/asktom/f?p=100:11:315369016275439::::P11_QUESTION_ID:6601312252730

Re: Oracle Coalesce vs Index Rebuild [message #487701 is a reply to message #487695] Thu, 30 December 2010 03:03 Go to previous messageGo to next message
paradoxkhan
Messages: 92
Registered: April 2008
Location: Pakistan
Member

We rebuild indexes because daily about 3 millions of records are deleted from that particular table and weekly 6 millions records are inserted.
So please explain in this scenario index rebuild is required or not? Seconds thing after index rebuild Table stat are required to collect?

Thanks,
Yasir
Re: Oracle Coalesce vs Index Rebuild [message #487702 is a reply to message #487701] Thu, 30 December 2010 03:38 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
Quote:
We rebuild indexes because daily about 3 millions of records are deleted from that particular table and weekly 6 millions records are inserted.

Most likely it is not. 3-6 million over 120 million is just 2.5-5%, not a big deal.

Quote:
Seconds thing after index rebuild Table stat are required to collect?

On the index, of course.

Regards
Michel
Re: Oracle Coalesce vs Index Rebuild [message #487706 is a reply to message #487687] Thu, 30 December 2010 04:09 Go to previous messageGo to next message
paradoxkhan
Messages: 92
Registered: April 2008
Location: Pakistan
Member

Thanks for update, what is your opinion about index Coalesce.

Re: Oracle Coalesce vs Index Rebuild [message #487708 is a reply to message #487706] Thu, 30 December 2010 04:12 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
In your case, I think it is useless unless something prove it is useful.

Regards
Michel

[Updated on: Thu, 30 December 2010 04:13]

Report message to a moderator

Re: Oracle Coalesce vs Index Rebuild [message #487921 is a reply to message #487708] Mon, 03 January 2011 06:13 Go to previous messageGo to next message
rleishman
Messages: 3728
Registered: October 2005
Location: Melbourne, Australia
Senior Member
If the indexes are on columns where the values deleted are similarly distributed to the values inserted, then you will find the inserted values eat up the space left by the deleted ones. These indexes do not need to be rebuilt.

That leaves indexes where the inserted vales are distributed differently to the deleted ones. This can happen with IDs allocated from a SEQUENCE (values always increasing) or with dates (also always increasing). For indexes that are always accessed with EQUALS clauses (often the case with IDs allocated from a sequence), you can create the index as a REVERSE KEY index. This will have the effect of homogenising the distribution of values. i.e. The inserted rows will eat up the space left by the deleted values.

That leaves DATE-based indexes: they are frequently accessed with range clauses like > / < / BETWEEN. You cannot make these REVERSE KEY because the range predicates will stop working. It is reasonable to rebuild or coalesce these indexes: BUT ONLY TO RECOUP SPACE, NOT FOR PERFORMANCE. When you delete a lot of old date values, it will leave those blocks in the index empty until the next rebuild/coalesce. It would be slow to read those old blocks and find nothing, but that will only happen if you scan on old values (or full scan) which you probably hardly ever do. If you scan on new values more often, you will be hitting the full blocks and will not get any performance hit from the empty blocks.

So find those indexes used in RANGE predicates that have ever-increasing values (like DATES) and coalesce them every couple of months to get space back.

Ross Leishman
Re: Oracle Coalesce vs Index Rebuild [message #487923 is a reply to message #487921] Mon, 03 January 2011 06:24 Go to previous messageGo to next message
Michel Cadot
Messages: 68716
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
For the last 2 paragraphs: note that if you delete all old dates, that is all entries in old index blocks, then these blocks will be reused by the next dates and so there is no need to coalesce (or rebuild).
Only the very special case where you delete most of keys in each (old) block but not all of them you can take advantage of these reorganizations.

Regards
Michel
Re: Oracle Coalesce vs Index Rebuild [message #487953 is a reply to message #487923] Mon, 03 January 2011 15:54 Go to previous messageGo to next message
rleishman
Messages: 3728
Registered: October 2005
Location: Melbourne, Australia
Senior Member
Michel, I was not aware that empty index blocks could be reused for values outside the range for which they were originally populated. I was of the understanding that they would lie empty waiting for new values in the same range.

I don't recall why I have this belief, so I concede that I could be very much mistaken.

I could probably search it or even benchmark it myself, but if you have a link to the manual handy that descibes the process, I would be appreciative.

Ross Leishman
Re: Oracle Coalesce vs Index Rebuild [message #487981 is a reply to message #487953] Mon, 03 January 2011 23:37 Go to previous message
ramoradba
Messages: 2457
Registered: January 2009
Location: AndhraPradesh,Hyderabad,I...
Senior Member
Oracle Coalesce vs Index Rebuild(10g(10.2.0.4))
http://richardfoote.wordpress.com/2008/02/08/index-rebuild-vs-coalesce-vs-shrink-space-pigs-3-different-ones/

sriram
Previous Topic: Parse once - Execute many
Next Topic: Procedure taking tomuch time in execution
Goto Forum:
  


Current Time: Fri Nov 22 02:00:58 CST 2024