[thesite] teo sidebar files modified and another SQL question

rudy r937 at interlog.com
Sun May 27 15:56:21 CDT 2001


>But, I think it would depend on where the indeces are.

correctamundo

any things that the database can do so as not to access actual records,
it'll try them first

> And there's no real way for me to know where the indeces are

there is, but this involves querying oracle's system tables

dean published a script recently but i haven't checked it out yet

>I'm kinda looking for a general rule here like "= is a faster
>operation than >, so it's better to limit the number of records in
>the > or < comparison", which would make sense to me.

yes, there are general rules --

range tests are bad
  where foo between bar and bat

EXISTS subqueries can be awful
  where not exists (select something)

IN tests against literals are lightning fast
IN tests against subqueries are also fast (they are done as joins)

stuff like that?

>Or, does the optimizer do all this anyway and I'm just fussing about
>nothing?

yes and yes, mostly


rudy





More information about the thesite mailing list