sql tuning
I have one sql statement, I get sql plan from the sql_id which I don't like
SELECT SUM(amount), MAX(date_posted) from ar_debit where debtornum = :p1 AND (dtype_r = :"SYS_B_0" OR stmtnum = :"SYS_B_1")
SQL> select plan_table_output from TABLE(DBMS_XPLAN.DISPLAY_CURSOR('7c69j4d2kcj8y',null,'typical +peeked_binds'));
PLAN_TABLE_OUTPUT
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
SQL_ID 7c69j4d2kcj8y, child number 0
-------------------------------------
SELECT SUM(amount), MAX(date_posted) from ar_debit where debtornum =
:p1 AND (dtype_r = :"SYS_B_0" OR stmtnum = :"SYS_B_1")
Plan hash value: 1585740249
------------------------------------------------------------------------------------------------
| Id | Operation | Name | Rows | Bytes | Cost (%CPU)| Time |