| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Re: 4 the FAQ: Are Commercial DBMS Truly Relational?
"Laconic2" <laconic2_at_comcast.net> wrote:
[snip]
>Another one:
>
>We have 30,000 addresses, but they all have COUNTRY = 'USA' in them. There
>is a query that
>specifies the state, city, and zip code, but doesn't specify the country.
>After all, why specify the country, when it's always 'USA' in this
>database? The query scans the index. We add the specification COUTRY =
But does the DBMS know that? If it does not, it has to make sure, just in case.
>'USA' to the WHERE clause, and all of a sudden it uses the index for
>lookup, which runs much faster.
>
>Can you figure out why each of these got sped up?
>Hint: think about compound index keys.
>
>Maybe these cases are much too simple to post in here, but back when I was
>making the big bucks, this is the sort of thing that made customers
>grateful!
Often, the solution is rather simple when using the/a right approach. Doing it the wrong way can have such complications.
Sincerely,
Gene Wirchenko
Computerese Irregular Verb Conjugation:
I have preferences.
You have biases.
He/She has prejudices.
Received on Sun Oct 10 2004 - 16:57:26 CDT
![]() |
![]() |