How many people here rebuid index regularly?
flag
Messages 1 - 10 of 33 - Collapse all
/groups/adfetch?adid=JoAxzhAAAAAhSfMQn0a-lPGBaHAsKQRL
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Follow-up To:
Add Cc | Add Follow-up to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers that you hear
 
1.  charlie cs nospam  
View profile   Translate to Translated (View Original)
 More options 5 Oct 2007, 03:10
Newsgroups: comp.databases.oracle.server
From: "charlie cs" <charliecs(nospam)@hotmail.com>
Date: Fri, 05 Oct 2007 02:10:00 GMT
Subject: How many people here rebuid index regularly?
We are on 9i Oracle.

Search on the internet, some expert say
"In the overwhelming majority of cases, indexes are extremely well
self-maintained and index rebuilds are NOT required, ever."

Tom Kytes in his website says
"The time lag between index rebuilds should be approximately FOREVER.
Tell me -- why why why WHY are you rebuilding them on a schedule?  What is
the scientific
basis in reality that is driving you to do this???? "

And some other site says:
"First rule of thumb is if the index has height greater than four,  rebuild
the index. For most indexes, the height of the index will be  quite low,
i.e. one or two. I have seen an index on a 3 million-row table that had
height three. An index with height greater than four  may need to be rebuilt
as this might indicate a skewed tree structure. "

Which one is right?

Thanks for your comments

Thanks


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
2.  hjr.pyth...@gmail.com  
View profile   Translate to Translated (View Original)
(3 users)  More options 5 Oct 2007, 04:16
Newsgroups: comp.databases.oracle.server
From: hjr.pyth...@gmail.com
Date: Thu, 04 Oct 2007 20:16:18 -0700
Local: Fri 5 Oct 2007 04:16
Subject: Re: How many people here rebuid index regularly?
On Oct 5, 12:10 pm, "charlie cs" <charliecs(nospam)@hotmail.com>
wrote:

You have to be certifiably insane to do index rebuilds just because
some rule-of-thumb somewhere says that if some metric you don't
understand reaches some value whose significance you don't understand
says you should.

What Tom Kyte is saying is "APPROXIMATELY forever". In other words,
not absolutely never, but very, very rarely when the specific
circumstances require it. A skewed index would be such a circumstance
(as would moving a table, doing DDL on a partitioned table with global
indexes, realising your queries are for Column A, B and your index is
built on Column B, A (though that's a re-create not a rebuild, but
close enough) and so on).

If you simply say, "Height 4... rebuild", that is a silly way to
manage a database. It's akin to saying, "Buffer Cache Hit Ratio = 75%,
must increase db_cache_size!"  Likewise "deleted leaf rows > 20% of
leaf rows" is a daft way to go, because deleted leaf row space will
sort itself out over time... unless the index is on something like a
sequence (or time), and thus monotonically incrementing, because then
you will never re-use that deleted leaf row space.... unless the
deleted leaf row space comes in such large chunks that it causes
entire blocks to be vacated, in which case you will...

I mean, in short, the subject is complicated and boiling it down to
moronic rules of thumb is a mug's games.

But, generally and with due caution, it is more or less fair to say
that if you HAD to have a rule of thumb that applied in a rhetorical
95% of cases for a rhetorical 95% of the time, it would be, "don't
rebuild your indexes". The risks of adopting that approach far
outweigh the costs associated with the other one of "rebuild your
indexes routinely because otherwise your CPU cycles just go to waste".

Certainly, you do not want to be ROUTINELY rebuilding your indexes.
(Having just scheduled a routine rebuild of an Intermedia index, I
know there are exceptions even to that rule provided you get precise
enough about it! But I'm assuming we're talking about regular b-tree
indexes here otherwise).


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
3.  hjr.pyth...@gmail.com  
View profile   Translate to Translated (View Original)
 More options 5 Oct 2007, 07:19
Newsgroups: comp.databases.oracle.server
From: hjr.pyth...@gmail.com
Date: Thu, 04 Oct 2007 23:19:23 -0700
Local: Fri 5 Oct 2007 07:19
Subject: Re: How many people here rebuid index regularly?
On Oct 5, 1:16 pm, hjr.pyth...@gmail.com wrote:

I meant, of course, "...the BENEFITS of adopting that approach far
outweigh the costs associated with the other one...."

Apologies for mangling my grammar.

:0


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
4.  Hasta  
View profile   Translate to Translated (View Original)
 More options 5 Oct 2007, 07:56
Newsgroups: comp.databases.oracle.server
From: Hasta <hasta...@hotmail.com>
Date: Fri, 5 Oct 2007 08:56:28 +0200
Local: Fri 5 Oct 2007 07:56
Subject: Re: How many people here rebuid index regularly?
In article <Y1hNi.7131$DF2.4804@trndny09>, "charlie cs" <charliecs
(nospam)@hotmail.com> says...

We do rebuild indexes, because it was measured to improve
performance on our system (9i).

See the thread "Proving or Debunking the need for rebuilding"
in this group for a report...

http://groups.google.be/group/comp.databases.oracle.server/browse_thr...
hl=fr&lnk=gst&q=+Proving+or+Debunking+the+need+for+rebuilding&rnum=1#
9e32aa3cf9282f81

--- Raoul


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
5.  Jonathan Lewis  
View profile   Translate to Translated (View Original)
(1 user)  More options 5 Oct 2007, 08:39
Newsgroups: comp.databases.oracle.server
From: "Jonathan Lewis" <jonat...@jlcomp.demon.co.uk>
Date: Fri, 5 Oct 2007 08:39:28 +0100
Local: Fri 5 Oct 2007 08:39
Subject: Re: How many people here rebuid index regularly?

"Hasta" <hasta...@hotmail.com> wrote in message

news:MPG.216ffe82b29bfb0e98968f@news.dommel.be...

> We do rebuild indexes, because it was measured to improve
> performance on our system (9i).

> See the thread "Proving or Debunking the need for rebuilding"
> in this group for a report...

> http://groups.google.be/group/comp.databases.oracle.server/browse_thread
> /thread/9579b57c3434d990/9e32aa3cf9282f81?
> hl=fr&lnk=gst&q=+Proving+or+Debunking+the+need+for+rebuilding&rnum=1#
> 9e32aa3cf9282f81

> --- Raoul

Raoul,

Did you ever find time to work out which indexes were
particularly relevant to the massive change in the batch
job, and what the difference was between the slow and
the fast runs ?

Running statspack at its default level 5 once per hour across
the batch job might give you some useful information about
the SQL with the biggest time change, and what made the
time change - level 6 would allow you to check if this was
due to plan changes, and level 7 might show you where the
I/O changed most.

--
Regards

Jonathan Lewis
http://jonathanlewis.wordpress.com

Author: Cost Based Oracle: Fundamentals
http://www.jlcomp.demon.co.uk/cbo_book/ind_book.html

The Co-operative Oracle Users' FAQ
http://www.jlcomp.demon.co.uk/faq/ind_faq.html


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
6.  Hasta  
View profile   Translate to Translated (View Original)
 More options 5 Oct 2007, 16:58
Newsgroups: comp.databases.oracle.server
From: Hasta <hasta...@hotmail.com>
Date: Fri, 5 Oct 2007 17:58:55 +0200
Local: Fri 5 Oct 2007 16:58
Subject: Re: How many people here rebuid index regularly?
In article <RcudnXIKhJSqd5jaRVny...@bt.com>, jonat...@jlcomp.demon.co.uk
says...

> Did you ever find time to work out which indexes were
> particularly relevant to the massive change in the batch
> job, and what the difference was between the slow and
> the fast runs ?

No, Jonathan, Unfortunatly I never investigated more as
of today, for lack of time and because the system is
working fine as is.

I certainly agree that only a few indexes actually
benefit from rebuild, and rebuilding them all is overkill
and detrimental to some extent.

On the other hand, rebuilding all indexes is quick
- on my system -, had no observable side effects in routine
work, and we dont have to carefully analyze and measure
whether a freshly added index actually needs a rebuild.


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
7.  Hasta  
View profile   Translate to Translated (View Original)
 More options 5 Oct 2007, 17:34
Newsgroups: comp.databases.oracle.server
From: Hasta <hasta...@hotmail.com>
Date: Fri, 5 Oct 2007 18:34:08 +0200
Local: Fri 5 Oct 2007 17:34
Subject: Re: How many people here rebuid index regularly?
In article <RcudnXIKhJSqd5jaRVny...@bt.com>, jonat...@jlcomp.demon.co.uk
says...

Your advice has been carefully saved, btw, Jonathan  ;-)

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
8.  hjr.pyth...@gmail.com  
View profile   Translate to Translated (View Original)
 More options 5 Oct 2007, 11:51
Newsgroups: comp.databases.oracle.server
From: hjr.pyth...@gmail.com
Date: Fri, 05 Oct 2007 03:51:30 -0700
Local: Fri 5 Oct 2007 11:51
Subject: Re: How many people here rebuid index regularly?
On Oct 5, 4:56 pm, Hasta <hasta...@hotmail.com> wrote:

Well, from what I read of that thread, you didn't measure very much
before, you weren't entirely certain on what to measure afterwards,
and it was all a bit vague and airy!

But that's standard fare in the 'I know my index rebuilds are
beneficial' industry: no-one actually every properly measures a darn'd
thing!

I don;t mean that in a critical way, by the way. More a frustration
thing: everyone has anecdotes, few have facts and figures.

Anyway, even if you happen to be of that rare breed, someone for whom
an index rebuild genuinely produces tangible, repeatable and
measureable benefits, fine: I have no problem with that. So long as
you, some third party with a bouffant hair-do or some poor innocent
newbie passing over this thread months or years from now understands:
that is not usual and it doesn't provide the basis for a simplistic
rule of thumb of the sort that says, "If Height>= 4 then rebuild;"


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
9.  Hasta  
View profile   Translate to Translated (View Original)
 More options 5 Oct 2007, 17:26
Newsgroups: comp.databases.oracle.server
From: Hasta <hasta...@hotmail.com>
Date: Fri, 5 Oct 2007 18:26:25 +0200
Local: Fri 5 Oct 2007 17:26
Subject: Re: How many people here rebuid index regularly?
In article <1191581490.312563.10...@o80g2000hse.googlegroups.com>,
hjr.pyth...@gmail.com says...

> > We do rebuild indexes, because it was measured to improve
> > performance on our system (9i).

> > See the thread "Proving or Debunking the need for rebuilding"
> > in this group for a report...

> > http://groups.google.be/group/comp.databases.oracle.server/browse_thr...
> > hl=fr&lnk=gst&q=+Proving+or+Debunking+the+need+for+rebuilding&rnum=1#
> > 9e32aa3cf9282f81

> > --- Raoul

> Well, from what I read of that thread, you didn't measure very much
> before, you weren't entirely certain on what to measure afterwards,
> and it was all a bit vague and airy!

Well, I cannot really agree, Howard

As I recall, that was a very long, very controlled measurement effort,
whose goal was to check whether our system did benefit from index
rebuilds.

I really expected to see that index rebuilds were not needed.

To my surprise, the test showed that the rebuilds were beneficial.
Trouble is that while the tests show with certainty a very
measurable change, I dont have data to know with certainty why.

The best hypothesis right now is :
* Many of our queries are optimized with index range scans.
* Some important indexes do index monotonically increasing fields -
mainly sequence and date primary keys.
* The delete pattern is such that 9 out of ten rows with consecutive
dates or sequences are deleted, leaving the corresponding indexes
with non empty but sparsely populated leaf blocks.
- Therefore range scans take longer

As I recall, and this is only an hypothesis...  All the
information I have is in the referenced thread - albeit in
bits and pieces, sorry.

About repeatability...  For various reasons it has happened
that some of our customers have been running without rebuilds
for a few weeks. And complained to our technical support that
the system was becoming slow.  The effect I have measured is
therefore very real, experienced by actual users in the field.

Sure.  I am not claiming anything more than what I have observed
*on our system* - and not suggesting anything more than "measure your
system"

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
10.  Hasta  
View profile   Translate to Translated (View Original)
 More options 5 Oct 2007, 17:47
Newsgroups: comp.databases.oracle.server
From: Hasta <hasta...@hotmail.com>
Date: Fri, 5 Oct 2007 18:47:17 +0200
Local: Fri 5 Oct 2007 17:47
Subject: Re: How many people here rebuid index regularly?
In article <MPG.2170841994c1cc35989...@news.dommel.be>, hasta_l3
@hotmail.com says...

BTW a favorite optimization technique here is that critical
queries get their data from the index alone. The underlying
table is not accessed at all.

--- Raoul


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message, you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google