3 basic oracle questions
From: David <dfairman16_at_hotmail.com>
Date: 19 Apr 2002 04:06:44 -0700
Message-ID: <b4cefdce.0204190306.257e318c_at_posting.google.com>
Date: 19 Apr 2002 04:06:44 -0700
Message-ID: <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?
- SELECT * FROM tblTest WHERE b=0 AND c=10
- SELECT * FROM tblTest WHERE c=10 AND b=0
- 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));
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 - 13:06:44 CEST