Query Running Slower On Oracle 11.2.0.2 Compared To Oracle 10.2.0.x (Doc ID 1374548.1)

Last updated on NOVEMBER 28, 2016

Applies to:

Oracle Database - Enterprise Edition - Version 11.2.0.2 and later
Information in this document applies to any platform.

Symptoms

Under circumstances the performance of queries may be degraded on 11gR2 (11.2.0.2) as compared to 10gR2.

The problem can be demonstrated by running the following alternative tests comparing 'select sysdate from dual' in both versions.

Anonymous Block:

set timing on

declare
  v_dt date;
begin
  FOR i IN 1 .. 100000 LOOP
    SELECT SYSDATE INTO v_dt FROM dual;
   END LOOP;
end;
/



PL/SQL Procedure:

set serveroutput on;

create or replace procedure chk_date_100000
as
  v date;
  tsStartTime TIMESTAMP;
  tsEndTime TIMESTAMP;
begin
  tsStartTime := CURRENT_TIMESTAMP;
  FOR i IN 1 .. 100000 LOOP
    SELECT SYSDATE INTO v FROM dual;
  END LOOP;
  tsEndTime := CURRENT_TIMESTAMP;
  DBMS_OUTPUT.PUT_LINE('Time elapsed:' || to_char(tsEndTime - tsStartTime));
end;
/

exec chk_date_100000;

Changes

Upgraded from Oracle 10g (10.2.0.5) to Oracle 11g (11.2.0.2).

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms