关于执行计划里recursivecalls,dbblockgets和consistentgets参数的解释
2008-04-27 00:58
591 查看
我们在实际工作中经常要看某个sql语句的执行计划,例如:
在sqlplus使用命令SETAUTOTRACEON后,执行计划显示如下:
SELECTSTATEMENTOptimizer=ALL_ROWS(Cost=985Card=1Bytes=26)
Statistics
----------------------------------------------------------
35recursivecalls
0dbblockgets
1052consistentgets
7168physicalreads
0redosize
395bytessentviaSQL*Nettoclient
512bytesreceivedviaSQL*Netfromclient
2SQL*Netroundtripsto/fromclient
0sorts(memory)
0sorts(disk)
1rowsprocessed
其中recursivecalls,dbblockgets,consistentgets的具体含义是什么?
具体解释如下:
·RecursiveCalls.Numberofrecursivecallsgeneratedatboththeuserandsystemlevel.
Databasemaintainstablesusedforinternalprocessing.Whenitneedstochangethesetables,OracleDatabasegeneratesaninternalSQLstatement,whichinturngeneratesarecursivecall.
Inshort,recursivecallsarebasicallySQLperformedonbehalfofyourSQL.So,ifyouhadtoparsethequery,forexample,youmighthavehadtorunsomeotherqueriestogetdatadictionaryinformation.Thesewouldberecursivecalls.Spacemanagement,securitychecks,callingPL/SQLfromSQL—allincurrecursiveSQLcalls.
·DBBlockGets.NumberoftimesaCURRENTblockwasrequested.
Currentmodeblocksareretrievedastheyexistrightnow,notinaconsistentreadfashion.
Normally,blocksretrievedforaqueryareretrievedastheyexistedwhenthequerybegan.Currentmodeblocksareretrievedastheyexistrightnow,notfromapreviouspointintime.
DuringaSELECT,youmightseecurrentmoderetrievalsduetoreadingthedatadictionarytofindtheextentinformationforatabletodoafullscan(becauseyouneedthe"rightnow"information,nottheconsistentread).Duringamodification,youwillaccesstheblocksincurrentmodeinordertowritetothem.
(DBBlockGets:请求的数据块在buffer能满足的个数)
·ConsistentGets.Numberoftimesaconsistentreadwasrequestedforablock.
Thisishowmanyblocksyouprocessedin"consistentread"mode.Thiswillincludecountsofblocksreadfromtherollbacksegmentinordertorollbackablock.
ThisisthemodeyoureadblocksinwithaSELECT,forexample.
Also,whenyoudoasearchedUPDATE/DELETE,youreadtheblocksinconsistentreadmodeandthengettheblockincurrentmodetoactuallydothemodification.
(ConsistentGets:数据请求总数在回滚段Buffer中)
·PhysicalReads.Totalnumberofdatablocksreadfromdisk.Thisnumberequalsthevalueof"physicalreadsdirect"plusallreadsintobuffercache.(PhysicalReads:实例启动后,从磁盘读到BufferCache数据块数量)
·Sorts(disk).Numberofsortoperationsthatrequiredatleastonediskwrite.SortsthatrequireI/Otodiskarequiteresourceintensive.TryincreasingthesizeoftheinitializationparameterSORT_AREA_SIZE.
在sqlplus使用命令SETAUTOTRACEON后,执行计划显示如下:
SELECTSTATEMENTOptimizer=ALL_ROWS(Cost=985Card=1Bytes=26)
Statistics
----------------------------------------------------------
35recursivecalls
0dbblockgets
1052consistentgets
7168physicalreads
0redosize
395bytessentviaSQL*Nettoclient
512bytesreceivedviaSQL*Netfromclient
2SQL*Netroundtripsto/fromclient
0sorts(memory)
0sorts(disk)
1rowsprocessed
其中recursivecalls,dbblockgets,consistentgets的具体含义是什么?
具体解释如下:
·RecursiveCalls.Numberofrecursivecallsgeneratedatboththeuserandsystemlevel.
Databasemaintainstablesusedforinternalprocessing.Whenitneedstochangethesetables,OracleDatabasegeneratesaninternalSQLstatement,whichinturngeneratesarecursivecall.
Inshort,recursivecallsarebasicallySQLperformedonbehalfofyourSQL.So,ifyouhadtoparsethequery,forexample,youmighthavehadtorunsomeotherqueriestogetdatadictionaryinformation.Thesewouldberecursivecalls.Spacemanagement,securitychecks,callingPL/SQLfromSQL—allincurrecursiveSQLcalls.
·DBBlockGets.NumberoftimesaCURRENTblockwasrequested.
Currentmodeblocksareretrievedastheyexistrightnow,notinaconsistentreadfashion.
Normally,blocksretrievedforaqueryareretrievedastheyexistedwhenthequerybegan.Currentmodeblocksareretrievedastheyexistrightnow,notfromapreviouspointintime.
DuringaSELECT,youmightseecurrentmoderetrievalsduetoreadingthedatadictionarytofindtheextentinformationforatabletodoafullscan(becauseyouneedthe"rightnow"information,nottheconsistentread).Duringamodification,youwillaccesstheblocksincurrentmodeinordertowritetothem.
(DBBlockGets:请求的数据块在buffer能满足的个数)
·ConsistentGets.Numberoftimesaconsistentreadwasrequestedforablock.
Thisishowmanyblocksyouprocessedin"consistentread"mode.Thiswillincludecountsofblocksreadfromtherollbacksegmentinordertorollbackablock.
ThisisthemodeyoureadblocksinwithaSELECT,forexample.
Also,whenyoudoasearchedUPDATE/DELETE,youreadtheblocksinconsistentreadmodeandthengettheblockincurrentmodetoactuallydothemodification.
(ConsistentGets:数据请求总数在回滚段Buffer中)
·PhysicalReads.Totalnumberofdatablocksreadfromdisk.Thisnumberequalsthevalueof"physicalreadsdirect"plusallreadsintobuffercache.(PhysicalReads:实例启动后,从磁盘读到BufferCache数据块数量)
·Sorts(disk).Numberofsortoperationsthatrequiredatleastonediskwrite.SortsthatrequireI/Otodiskarequiteresourceintensive.TryincreasingthesizeoftheinitializationparameterSORT_AREA_SIZE.
相关文章推荐
- 关于执行计划里recursive calls,db block gets和consistent gets参数的解释
- 执行计划里recursive calls,db block gets和consistent gets参数的解释
- 执行计划里recursive calls,db block gets和consistent gets参数的解释
- 对'Consistent Gets',''Physical Reads'和'DB Block Gets'的理解和解释
- 执行计划之:consistent gets ,db block gets
- +++consistent read(读一致性)的通俗理解 & db block gets的解释
- 对'Consistent Gets',''Physical Reads'和'DB Block Gets'的理解和解释
- 对于'Consistent Gets',''Physical Reads'和'DB Block Gets'的理解和解释
- 对'Consistent Gets',''Physical Reads'和'DB Block Gets'的理解和解释
- 对于'Consistent Gets',''Physical Reads'和'DB Block Gets'的理解和解释
- 关于oracle初始化参数中db_writer_processes和dbwr_io_slaves含义的解释
- [Postgres] 如何读懂执行计划:参数解释
- 执行计划中的参数解释
- oracle 执行计划 consistent gets 特别高sql执行慢 解决办法
- db_block_gets和consistent_gets
- +++对于db block gets consistent gets physical reads的大收集和总结
- 关于 db block gets,consistent gets,physical reads的概念
- LOGIC IO(逻辑读次数)= db block gets + consistent gets
- 关于 db block gets,consistent gets,physical reads的概念
- db block gets (current gets) VS. consistent gets