Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

DISTINCT operator performance issue

611275Jul 30 2008 — edited Aug 1 2008
Hi Guyz,

I am facing a performance issue in a query which contains DISTINCT function. Following is my query:

SELECT /*+ ORDERED USE_NL_WITH_INDEX(c DIMENSION_KEY_PK) */
DISTINCT f.*,c.client_ids
FROM FACT_TAB f, DIM_TAB c
WHERE f.client = c.dimension_key

FACT_TAB = Fact table with a bitmap index on client column (10,000,000 records).
DIM_TAB = Dimension table with dimension_key as primary key (100,000 records).

when i select only fact table columns in the above query, the query executes within a second. But when i execute the above query it takes more than 15 minutes to execute.

How can i improve the above query. Any suggestions or tips would be helpful.

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 29 2008
Added on Jul 30 2008
20 comments
3,897 views