Full Table scan - Query without where clause [message #589856] |
Thu, 11 July 2013 08:09 |
ishika_20
Messages: 339 Registered: December 2006 Location: delhi
|
Senior Member |
|
|
Dear All,
Below query is degrading the performance of database. As we know that, without where clause, query do full table scan.
Now, it is written to generate the sequence no. So I am confused to optimized it. Kindly let me know what steps should we take to optimize it.
SQL> explain plan for
2 SELECT NVL(MAX(P.NUM_SERIAL_NO), 0) + 1 FROM CNFGTR_IRDA_ENVELOPE_DTLS P
3 /
Explained.
SQL> select * from table(dbms_xplan.display());
PLAN_TABLE_OUTPUT
----------------------------------------------------------------------------------------------------
Plan hash value: 3345343365
------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |
------------------------------------------------------------------------------------------------
| 0 | SELECT STATEMENT | | 1 | 4 | 7540 (1)| 00:01:31 |
| 1 | SORT AGGREGATE | | 1 | 4 | | |
| 2 | TABLE ACCESS FULL| CNFGTR_IRDA_ENVELOPE_DTLS | 300K| 1172K| 7540 (1)| 00:01:31 |
------------------------------------------------------------------------------------------------
9 rows selected.
Index is not created on the column.
Need your kind assistance on this...
Regards,
Ishika
|
|
|
|
|
|
|
|
|