您的位置:首页 > 其它

关于执行计划里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.
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: