当前位置:网站首页>[20201204] why 2 rows of record.txt are returned

[20201204] why 2 rows of record.txt are returned

2020-12-08 12:07:12 Irving the procedural ape

[20201204] Why return to 2 rows .txt

--// stay itpub Questions to ask =>[20180907] visit v$ Views and consistent reads .txt

1. Ask questions :
SCOTT@book> @ ver1

PORT_STRING                    VERSION        BANNER
------------------------------ -------------- --------------------------------------------------------------------------------
x86_64/Linux 2.4.xx            11.2.0.4.0     Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

SCOTT@book> select sid from v$mystat where rownum=1;
       SID
----------
        32

SCOTT@book> select  sid ,osuser  from v$session where sid = 32;
       SID OSUSER
---------- ------------------------------
        32 oracle
--// return 1 That's ok . If you add a prompt .

SCOTT@book> alter session set statistics_level = all;
Session altered.

SCOTT@book> select /*+ leading(s e w) */ sid ,osuser  from v$session where sid = 32;
       SID OSUSER
---------- ------------------------------
        32 oracle
        32 oracle

--// View execution plan :
SCOTT@book> @ dpc '' ''
PLAN_TABLE_OUTPUT
-------------------------------------
SQL_ID  41djy6556s87h, child number 1
-------------------------------------
select /*+ leading(s e w) */ sid ,osuser  from v$session where sid = 32
Plan hash value: 1247622051
---------------------------------------------------------------------------------------------------------------------------------------------
| Id  | Operation                 | Name            | Starts | E-Rows |E-Bytes| Cost (%CPU)| A-Rows |   A-Time   |  OMem |  1Mem | Used-Mem |
---------------------------------------------------------------------------------------------------------------------------------------------
|   0 | SELECT STATEMENT          |                 |      1 |        |       |     1 (100)|      2 |00:00:00.01 |       |       |          |
|   1 |  NESTED LOOPS             |                 |      1 |      1 |   108 |     0   (0)|      2 |00:00:00.01 |       |       |          |
|   2 |   MERGE JOIN CARTESIAN    |                 |      1 |      1 |    82 |     0   (0)|   1367 |00:00:00.01 |       |       |          |
|*  3 |    FIXED TABLE FIXED INDEX| X$KSUSE (ind:1) |      1 |      1 |    69 |     0   (0)|      1 |00:00:00.01 |       |       |          |
|   4 |    BUFF.........

版权声明
本文为[Irving the procedural ape]所创,转载请带上原文链接,感谢
https://chowdera.com/2020/12/202012081205144143.html