Slow performance for dual table and views after upgrading from 10g to 19c

1.2k Views Asked by At

After upgrading the Oracle database from 10g to 19c, I'm experienced the performance issue as querying in dual table and views on a large database when using update/ insert statement. I've to wait for more than a hour when comparing the performance of views in Oracle database 10g.

--use Views
update table1
set break_show ='Y'
where developer in (select developer_dis from view1 where rn1 <=10 or rn2 <=10);

--use Table
update table1
set break_show ='Y'
where developer in (select developer_dis from table2 where rn1 <=10 or rn2 <=10);

I had to set EXECUTE IMMEDIATE 'alter session set optimizer_features_enable="10.2.0.4"';, and this fixed by bad performance.

What should I do to find out the real reason that the dual table and views are running slow.

Any help would be appreciated.

1

There are 1 best solutions below

0
On

I don't see any reference to the dual table?

But with any major upgrade, the optimizer goes through a lot of changes. For most of the queries, that should yield same or better performance, but there will always be a risk of a regression. You can use

select * from dbms_xplan.display_cursor('[sqlid]')

for each query (get the SQL_ID from V$SQL) to see the different plans, and then decide from there on a course of action. One of the nice things you'll now have with 19c is SQL Plan Management, so you can force the optimizer to keep using your 10g plan, whilst still capturing potentially better plans over time.