SQL Performance (MOSC)

MOSC Banner

suggestion to optimize select statement

edited Feb 19, 2020 4:06AM in SQL Performance (MOSC) 1 commentAnswered ✓

Hi all,

I am trying to get this output but it never completes even with parallel slave. Could anyone give some improvement recommendation please ?

-- SQL statement ---

select count(distinct c.prod_id) from st_fdb_cat c,st_product s where c.prod_id <> s.sp_prod_id and c.xfer_date >sysdate-2

--- Execution Plan ---

Plan hash value: 2577303958

----------------------------------------------------------------------------------------------------------------

| Id  | Operation                 | Name                       | Rows  | Bytes |TempSpc| Cost (%CPU)| Time     |

----------------------------------------------------------------------------------------------------------------

|   0 | SELECT STATEMENT          |                            |     1 |    42 |       |  6386M  (2)|999:59:59 |

|   1 |  SORT AGGREGATE           |                            |     1 |    42 |       |            |          |

|   2 |   VIEW                    | VW_DAG_0                   | 41561 |  1704K|       |  6386M  (2)|999:59:59 |

|   3 |    HASH GROUP BY          |                            | 41561 |  1542K|    24T|  6386M  (2)|999:59:59 |

|*  4 |     HASH JOIN             |                            |   601G|    20T|  5952K|  2159M  (1)|999:59:59 |

|   5 |      INDEX FAST FULL SCAN | ST_PRODUCT_INFO_PRODUCT_ID |   338K|  1982K|       |   174   (2)| 00:00:03 |

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

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

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center