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!

indexes on global temp table

ManjitOct 20 2015 — edited Oct 21 2015

select e.emp_name,e.emp_age,temp.emp_salary,temp.emp_highest_salary from Employee e ,emp_temporory_table temp where temp.emp_id = e.emp_id

The above query  runs in one of our PL-SQL procedure,and found that it is hogging 90% CPU.

Here is the create table script for the global table.

CREATE GLOBAL TEMPORARY TABLE emp_TEMPORORY_TABLE

   ( "EMP_ID" NUMBER(12,0),

  "EMP_HIGHEST_SALARY NUMBER(12,0)

   ) ON COMMIT DELETE ROWS ;

  

  

In UAT environment we really dont see the issue because I guess we dont have the volume of data in the Employee table(it is a massive table in production...around 8 million records)in uat.

But in production we see the issue everytime.Even after gathering the statistics in the employee table we still see the issue.

I am about to propose to create an index in the global temporory table emp_temporory_table (on emp_id) ,to see if this helps.

What do you guys think.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Nov 18 2015
Added on Oct 20 2015
14 comments
2,330 views