Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Data Bases > Databases General > Re: The 20% rul...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 2 of 4 Topic 3224 of 3295
Post > Topic >>

Re: The 20% rule

by Ed Prochak <edprochak@[EMAIL PROTECTED] > Jul 24, 2008 at 09:37 AM

On Jul 24, 9:01 am, aark...@[EMAIL PROTECTED]
 wrote:
> Hi all,
>
>  I recently read the following in a book(oracle 9i for dummies by
> Carol McCullough Dieter)
>
> The fastest way to retrieve rows from a table is to access the row
> with exact row id. An
> index is the second fastest way, but it decreases in performance as
> the pro****tion of the rows retrieved increases. if you are retrieving
> approximately 20 % of the rows in a table, using a index is just as
> fast. But beyond that magic 20 %, not using 20% is faster.
>
> keep this rule in mind when you create indexes intended to help speed
> up a query.
> Queries vary in the rows that they select from a table. if you have a
> query that you use often,
> determine the number of rows that it selects from the table. if this
> number is more than 20%
> of the total no: of rows in the table  , an index on the table may not
> improve the performance
> of the query. you may just want to try both methods. if the number of
> rows is less than 20%, an index will almost certainly help
> performance.
>
> my question is to what extent this rule is true ?

As with all performance questions the answer is "it depends".
That is why there is EXPLAIN PLAN and other performance measures.

Here's the simple counter example for the 20% "rule"
SELECT * FROM sometable WHERE ColumnWith20Percent IS NULL;
since indices do not track NULLs.

You best bet is to remember that this is not a hard rule, but a
general guideline. The paragraph you quoted (or at least paraphrased)
hints at this since it says: "you may just want to try both methods".
to quote the raven: It's a guideline, nothing more.

HTH,
  ed
 




 4 Posts in Topic:
The 20% rule
aarklon@[EMAIL PROTECTED]  2008-07-24 07:01:05 
Re: The 20% rule
Ed Prochak <edprochak@  2008-07-24 09:37:16 
Re: The 20% rule
Robert Klemme <shortcu  2008-07-27 14:27:00 
Re: The 20% rule
"David Cressey"  2008-07-24 19:14:27 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Fri Dec 5 9:40:40 CST 2008.