Question about use of DISTINCT

  • From: Sandra Becker <sbecker6925@xxxxxxxxx>
  • To: oracle-l <oracle-l@xxxxxxxxxxxxx>
  • Date: Mon, 17 Oct 2011 12:49:01 -0600

IBM zSeries
SUSE 10
Oracle EE 10.2
A developer recently put some code into production that I did not get to see
until 3 days later when it was failing part way through and causing problems
with the other part.  One of the things I noticed was the use of DISTINCT on
columns that are already unique.  Because of the predicates and the way the
primary keys were defined, they will never use the primary key index or any
other unique index on the tables.

Question:  Is using the DISTINCT on a column that is already unique causing
unnecessary overhead or is it just superfluous and the database is smart
enough to ignore it?  I've run a few explain plans and the use of the
DISTINCT does not change the explain plan.

-- 
Sandy
Transzap, Inc.


--
//www.freelists.org/webpage/oracle-l


Other related posts: