How to make this simple sql run faster?

Here is a very simple sql, but it takes too long to finish as an hour or more, and the problem is in the table. It's a huge table with 17660025 lines.
In addition, upd_dt is indexed.
select distinct (dstn_type) from ims_ets_prty_msge where ims_ets_prty_msge.upd_dt > sysdate - 30;
Execution plan seems to be no problem: (is 9i, and I do not think that it would not perform better if the UNIQUE HASH is used instead of SORT UNIQUE)
-----------------------------------------------------------------------------------------
| Id  | Operation                    |  Name                    | Rows  | Bytes | Cost  |
-----------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT             |                          |     6 |    78 |  1409 |
|   1 |  SORT UNIQUE                 |                          |     6 |    78 |  1409 |
|   2 |   TABLE ACCESS BY INDEX ROWID| IMS_ETS_PRTY_MSGE        |   856K|    10M|    10 |
|*  3 |    INDEX RANGE SCAN          | IMS_ETS_PRTY_MSGE_INDX5  |   154K|       |     2 |
-----------------------------------------------------------------------------------------
 
Predicate Information (identified by operation id):
---------------------------------------------------
 
   3 - access("IMS_ETS_PRTY_MSGE"."UPD_DT">SYSDATE@!-30)
 
Note: cpu costing is off
Here is some info on the table
NUM_ROWS BLOCKS  EMPTY_BLOCKS AVG_SPACE CHAIN_CNT AVG_ROW_LEN
17129540      455259     622           502             455278      188
The thing is that we must make it run faster.
And all I can think is to create a bitmap on dstn_type (low cardinality) index and partition the table using upd_dt;

So my question would be is anyway that we can get a better response time without having to make that kind of change?
Or is this kind of change really help?

Any thoughts would be appreciated!

Thank you

Have you thought about putting an index on (upd_dt, dstn_type)?

With the query you posted, and this index, it should be possible to use a full scan of the index, no visit to the table at all.

A bitmap index would not be a good idea, if it is an OLTP application / table.

Tags: Database

Similar Questions

Maybe you are looking for