Skip to Main Content

SQL Developer

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!

SQL Developer gets 100% CPU when querying SQL, do not understand why.

1041351Jul 28 2014 — edited Jul 29 2014

Was posted in SQL Forum before:

Hello,

I have an SQL and when firing in SQL Developer 4 it works. First 50 rows are shown immediately. But now when using [CTRL] + [End] to load all Datasets it runs and runs and...

And CPU usage (of sql developer client) is on 100% (straight Line, no pulse).

The SQL consists of a sub-query, which unions all base data, and an outer join, where I join a specific ID to all base datasets.

When querying only the inner sub-query using [CTRL] + [End] it returns (! so it does it!) about 220.000 rows in under 30 seconds.

Well may that are much rows, but SQL Developer returns them within 30 seconds!

When now querying the whole SQL with my ID join, it runs and runs and...

When I abort it after any time it only loaded about 120.000 rows within that time.

There are several things I do not understand:

- why is it a problem to join a ID to 220.000 datasets?

   - every of the base datasets does exactly have one ID which I am going to join to

- why is this a problem of my local CPU? I would expect a slow down on the database but not on my client?

   - It was able to show 220.000 datasets before, why is now only able to load 120.000 datasets within that time?

- why does sql developer keep 100% CPU and hence kill my client after aborting the query?

Heres my SQL:

  1. SELECT * 
  2. FROM TABLE_ID t_id_1 
  3. LEFT JOIN table_hop_2 t_hop_2 ON t_hop_2.TH2_ID = t_id_1.T1_ID 
  4. LEFT JOIN table_hop_3 t_hop_3 ON t_hop_3.TH3_ID = t_hop_2.TH2_ID 
  5. LEFT JOIN 
  6.   SELECT 
  7.   'STRING_TYPE_1' AS TEST_TYPE 
  8.   , sub_t_4.COLL2 AS COLL2 
  9.   , sub_t_4.COLL3 AS COLL3 
  10.   , sub_t_4.COLL4 AS COLL4 
  11.   , sub_t_4.COLL5 AS COLL5 
  12.   , sub_t_4.COLL6 AS COLL6 
  13.   FROM SUB_TABLE_4 sub_t_4 
  14.  
  15.   UNION ALL 
  16.  
  17.   SELECT 
  18.   'STRING_TYPE_2' AS TEST_TYPE 
  19.   , sub_t_5.COLL2 AS COLL2 
  20.   , sub_t_5.COLL3 AS COLL3 
  21.   , sub_t_5.COLL4 AS COLL4 
  22.   , sub_t_5.COLL5 AS COLL5 
  23.   , sub_t_5.COLL6 AS COLL6 
  24.   FROM SUB_TABLE_5 sub_t_5 
  25.  
  26.   UNION ALL 
  27.  
  28.   SELECT 
  29.   'STRING_TYPE_3' AS TEST_TYPE 
  30.   , sub_t_6.COLL2 AS COLL2 
  31.   , sub_t_6.COLL3 AS COLL3 
  32.   , sub_t_6.COLL4 AS COLL4 
  33.   , sub_t_6.COLL5 AS COLL5 
  34.   , sub_t_6.COLL6 AS COLL6 
  35.   FROM SUB_TABLE_6 sub_t_6 
  36. ) sub_union_7 ON sub_union_7.COLL2 = t_hop_3.COLL2_equivalent 

SELCT COUNT (*) from SQL above returns 183131 within 1ms.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 26 2014
Added on Jul 28 2014
3 comments
2,532 views