Re: 4 the FAQ: Are Commercial DBMS Truly Relational?
Date: Sun, 10 Oct 2004 14:57:26 -0700
Message-ID: <0abjm0h21kvh2ibl4oseihuu87ug81v6gp_at_4ax.com>
"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 - 23:57:26 CEST