Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> comp.databases.theory -> Re: A DBMS implementation Question

Re: A DBMS implementation Question

From: Jan Hidders <jan.hidders_at_REMOVE.THIS.ua.ac.be>
Date: 28 Feb 2003 21:01:43 +0100
Message-ID: <3e5fc027.0@news.ruca.ua.ac.be>


owen wrote:
>
>Some small rational dbms use B tree for indexing. I found a problem in the
>condition that the key for the table is a multiple key. For example
>, there is a table which is denoted as emp(no, age, name), and (no +
>age) is the key for indexing.In the B Tree, the values of "no" and "age"
>are transfered to String and merge together, such as the key value of
>(1, 20, "abc") is "00010020",and the the B Tree of the table is
>established by the sequence of the key.

Not necessarily, you can define a B-tree on a combination of columns and most DBMSs have this possibility.

> Now , I have a problem , if I want to query all the people whose
> age are more than 20 , which is described as "select * from emp
> where age > 20", i can't use b tree for indexing, if i use , the
> number of records that i must scan may be very large, how to sovle
> the problem.
> The problem can be expressed as "how to deal with scaning the table
> using non-primary key or non-key field".

Define an extra index on them. There is no reason why indices should be limited to key columns.

Received on Fri Feb 28 2003 - 14:01:43 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US