POV-Ray : Newsgroups : povray.off-topic : Aren't complexity classes fun? : Re: Aren't complexity classes fun? Server Time
7 Sep 2024 05:11:55 EDT (-0400)
  Re: Aren't complexity classes fun?  
From: Gail Shaw
Date: 31 Jul 2008 07:15:18
Message: <48919ec6@news.povray.org>
"Invisible" <voi### [at] devnull> wrote in message
news:48917361$1@news.povray.org...

> Although - and not many people seem to understand this part - indexes
> make looking up *one* element much faster (if you index the right
> thing). However, if you're doing to end up needing to process a large
> percentage of the table anyway, it's actually faster to *not use* any
> indexes there might be.

Really? I'll go and discard everything I know about using indexes right
away....

If you're processing a portion of a table and you have an index that covers
the required columns and finds you the portion of the table you want, it's
much, much better to use the index than to scan the table. Think about it
this way. If you need all the entries in the phone book where the first
letter of the surname in between N and T, would you prefer the phone book
ordered by surname or would you prefer an unorganised heap of phone book
entries?


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.