October 2005
Intermediate to advanced
454 pages
14h 44m
English
At this point, you might be wondering how the database partitions the query results. Does Oracle execute one query per parallel function instance or does it execute a single query and partition its results? Let’s find out by looking in the shared pool.
SQL>SELECT sql_text,2parse_calls,3executions4FROM v$sql5WHERE INSTR(UPPER(sql_text),'ACCT_TRANSACTIONS') > 06AND INSTR(UPPER(sql_text),'SQL_TEXT') = 07AND command_type = 3;SQL_TEXT PARSE_CALLS EXECUTIONS ------------------------- ----------- ---------- SELECT * FROM TABLE(are 1 1 a_summary(CURSOR(SELECT * FROM acct_transactions))) SELECT "A3"."AREA" "AREA" 1 1 ,"A3"."TRX_DATE" "TRX_DAT E","A3"."TRX_AMT" "TRX_AM T" FROM "ACCT_TRANSACTION S" "A3" ORDER BY "A3"."AR EA"
There are only two cursors here: the one I executed and the one executed within the table function, each with a parse and execute count of 1. That means that a single cursor is used and that Oracle partitions the returned rows as requested.