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!

How can i optimize my query

sinan_ggFeb 4 2016 — edited Feb 11 2016

Hi All,

According to the query i have written below, i wonder why there was a difference between exadata development and exadata production systems run times.

Development Execution Duration : 15 min

Production Execution Duration : 75 min

In both systems, my source tables (trxn_data and base_data) have nearly same data. i loaded %95 of data from production to developmet tables. And in both systems, i did gather table statistics.

SELECT a.ip_id

FROM base_data a,

   (SELECT   ip\_id, SUM (instalment\_amount), ......

        FROM trxn\_data b

       WHERE trx\_status\_code IN (4, 5, 7, 24, 25, 27)

         AND trn1\_date > TO\_DATE ('07.02.2015', 'DD.MM.YYYY')

         AND trn1\_date \<= TO\_DATE ('02.02.2016', 'DD.MM.YYYY')

    GROUP BY ip\_id) b

WHERE a.ip_id = b.ip_id(+)

trxn_data : Row_Count(DVL) => 844.006.644

trxn_data : Row_Count(PRD) => 881.625.577

base_data : Row_Count(DVL) => 13.176.888

base_data : Row_Count(PRD) => 13.350.035

Development System Plan Output

Capture.JPG

Production System Plan Output

Capture2.JPG

Oracle Version :

Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

PL/SQL Release 11.2.0.4.0 - Production

CORE 11.2.0.4.0 Production

TNS for Linux: Version 11.2.0.4.0 - Production

NLSRTL Version 11.2.0.4.0 - Production

Is there any advice about this situation ?

Thanks,

Sinan,

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 10 2016
Added on Feb 4 2016
9 comments
1,834 views