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

Home -> Community -> Usenet -> c.d.o.server -> Re: second part of index use

Re: second part of index use

From: DA Morgan <damorgan_at_psoug.org>
Date: Fri, 06 Jul 2007 13:46:02 -0700
Message-ID: <1183754761.575190@bubbleator.drizzle.com>


codefragment_at_googlemail.com wrote:
> Hi
> You have a table with 'n' columns, 2 of which are employeecode and
> date. You also have a clustered index on (date, employeecode). You
> have a query which looks for an employee with
> dates between DateA and DateB.

If you are in Oracle you do not have a clustered index unless your table is in a portion of a tablespace in which a cluster has been created.

What you have is Oracle ... not SQL Server.

> (1) The query uses the index to get to DateA, how does it then find
> the employee? Is the date/employee hashed in some way? Does it first
> find the date then scan to get the employee?

http://tahiti.oracle.com and look up index concepts

And the answer to your question is no.

> (2) In general does it make more sense to cluster on date then
> employee or employee then date.

It makes more sense to stop using the word cluster as it is totally inappropriate in this context. You need to read a book, or a manual, or take a class, and learn basic Oracle concepts.

-- 
Daniel A. Morgan
University of Washington
damorgan_at_x.washington.edu (replace x with u to respond)
Puget Sound Oracle Users Group
www.psoug.org
Received on Fri Jul 06 2007 - 15:46:02 CDT

Original text of this message

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