Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

what is the difference between shared hint and prallel hint?

In the database, I have noticed a query running with shared hint.

    SELECT /*+ SHARED (8) */ ID from tab1

I execute the query plan to understand more about it , I notice px send qc which means parallel

-----------------------------------------------------------------------------------------
| Id | Operation                 | Name            | Rows     | Bytes     | Cost | Time |
-----------------------------------------------------------------------------------------
|  0 | SELECT STATEMENT          |                 | 58773659 | 235094636 | 7389 |      |
|  1 |   PX COORDINATOR          |                 |          |           |      |      |
|  2 |    PX SEND QC (RANDOM)    | :TQ10000        | 58773659 | 235094636 | 7389 |      |
|  3 |     PX BLOCK ITERATOR     |                 | 58773659 | 235094636 | 7389 |      |
|  4 |      INDEX FAST FULL SCAN | IDX_RTEST3      | 58773659 | 235094636 | 7389 |      |
-----------------------------------------------------------------------------------------

I have execute parallel hint and I have got the same results, then what is the different between shared and parallel hint?

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

 select /*+parallel(8) */ ID from tab1

>Solution :

There isn’t really a difference. Oracle-generated code sometimes uses shared, but as that isn’t documented you should probably stick to parallel in your own code.

See MoS document 2416478.1 for a bit more information – I can’t quote from that because it requires a support contract to view it.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading