Re: 3 basic oracle questions

From: Jim Kennedy <kennedy-family_at_attbi.com>
Date: Fri, 19 Apr 2002 14:11:19 GMT
Message-ID: <aAVv8.83866$CH1.75100_at_sccrnsc02>


Answers below. Best thing is to test it.

"David" <dfairman16_at_hotmail.com> wrote in message news:b4cefdce.0204190306.257e318c_at_posting.google.com...
> Hello, I have an imaginary table tblTest, that will be created in
> Oracle and defined as below.
>
> CREATE TABLE tblTest(aNUMBER, b NUMBER, c NUMBER, PRIMARY KEY (a),
> UNIQUE (b,c));
>
> For the purposes of my query, imagine that there are 50 million
> records in the table, and a value of 'b' is 0 in 10 of the records,
> and the value of 'c' is 10 in 9 million of the records.
>
> My questions are:
> 1. Is one of these queries more efficient/quicker than the other?
> a) SELECT * FROM tblTest WHERE b=0 AND c=10
> b) SELECT * FROM tblTest WHERE c=10 AND b=0
Shouldn't matter.

>
> 2. Would the query efficiency be different in each case if, during
> table creation, I had used the query below instead?
>
> CREATE TABLE tblTest(aNUMBER, b NUMBER, c NUMBER, PRIMARY KEY (a),
> UNIQUE (c,b));
>
If you create a unique index and use compression then 1 should be faster. Jim
> 3. UNIQUE is essentially the equivalent to ALTERNATE KEY used by many
> other DBMS vendors isn't it?
>
> Thank you
> David
Received on Fri Apr 19 2002 - 16:11:19 CEST

Original text of this message