Please use the code button, without that it was horrible to read !
So it still takes more than 2 minutes. No, looking at the Tkprof provide it took only 15 secs and the query got completed and you kept the sql*plus session idle for 261 sec ( without sending any message/request to the server)
http://docs.oracle.com/database/121/REFRN/GUID-DFF273D1-3A48-424D-89F8-1971AC95E31B.htm#REFRN00632 call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.00 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 117826 15.17 15.43 17379 134063 0 1767373
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 117828 15.17 15.44 17379 134063 0 1767373
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 998
Number of plan statistics captured: 1
Rows (1st) Rows (avg) Rows (max) Row Source Operation
---------- ---------- ---------- ---------------------------------------------------
1767373 1767373 1767373 TABLE ACCESS FULL FROZEN_WOAPPOINT (cr=134063 pr=17379 pw=0 time=9836353 us cost=4787 size=123716110 card=1767373)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 117826 0.00 0.65
direct path read 2 0.00 0.00
SQL*Net message from client 117826 73.68 261.22
********************************************************************************
Table sized 144 MB is really, really tiny these days.
Here is my demo on more than 1GB sized table from 12c database.
demo@ORA12C> exec show_space('BIG_TABLE');
Unformatted Blocks ..................... 0
FS1 Blocks (0-25) ..................... 0
FS2 Blocks (25-50) ..................... 0
FS3 Blocks (50-75) ..................... 0
FS4 Blocks (75-100)..................... 21
Full Blocks ..................... 157,101
Total Blocks............................ 158,240
Total Bytes............................. 1,296,302,080
Total MBytes............................ 1,236
Unused Blocks........................... 0
Unused Bytes............................ 0
Last Used Ext FileId.................... 8
Last Used Ext BlockId................... 350,848
Last Used Block......................... 296
PL/SQL procedure successfully completed.
demo@ORA12C> @tkfilename.sql
D:\APP\VNAMEIT\diag\rdbms\ora12c\ora12c\trace\ora12c_ora_6784.trc
PL/SQL procedure successfully completed.
demo@ORA12C> @tktrace.sql
Session altered.
PL/SQL procedure successfully completed.
demo@ORA12C> select /*+ full(t) */ count(*) from big_table t;
COUNT(*)
----------
10000000
1 row selected.
demo@ORA12C> exit
Disconnected from Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options
and the Tkprof shows this.
SQL ID: 1rp4sd53cubpy Plan Hash: 599409829
select /*+ full(t) */ count(*)
from
big_table t
call count cpu elapsed disk query current rows
------- ------ -------- ---------- ---------- ---------- ---------- ----------
Parse 1 0.00 0.09 0 0 0 0
Execute 1 0.00 0.00 0 0 0 0
Fetch 2 1.21 15.52 157122 157134 0 1
------- ------ -------- ---------- ---------- ---------- ---------- ----------
total 4 1.21 15.61 157122 157134 0 1
Misses in library cache during parse: 1
Optimizer mode: ALL_ROWS
Parsing user id: 135
Number of plan statistics captured: 1
Rows (1st) Rows (avg) Rows (max) Row Source Operation
---------- ---------- ---------- ---------------------------------------------------
1 1 1 SORT AGGREGATE (cr=157134 pr=157122 pw=0 time=15526145 us)
10000000 10000000 10000000 TABLE ACCESS FULL BIG_TABLE (cr=157134 pr=157122 pw=0 time=12837620 us cost=43042 size=0 card=10000000)
Elapsed times include waiting on following events:
Event waited on Times Max. Wait Total Waited
---------------------------------------- Waited ---------- ------------
SQL*Net message to client 2 0.00 0.00
direct path read 4828 0.24 13.20
SQL*Net message from client 2 0.00 0.00
********************************************************************************