欧美一区二区三区老妇人-欧美做爰猛烈大尺度电-99久久夜色精品国产亚洲a-亚洲福利视频一区二区

oracle水位線怎么看,oracle 高水位線查詢

水位線是什么意思 水位線如何解釋

1、水位線(High Water Mark)在工程地質(zhì)、巖土工程、水利水電工程等專業(yè)的地質(zhì)剖面圖等專業(yè)圖件中表示地表水或地下水水位的線,稱作水位線。線型為虛線,符號為▽下面加三條長度依次減小的線段。

創(chuàng)新互聯(lián)專注于企業(yè)網(wǎng)絡(luò)營銷推廣、網(wǎng)站重做改版、龍勝網(wǎng)站定制設(shè)計、自適應(yīng)品牌網(wǎng)站建設(shè)、HTML5建站商城網(wǎng)站定制開發(fā)、集團(tuán)公司官網(wǎng)建設(shè)、成都外貿(mào)網(wǎng)站制作、高端網(wǎng)站制作、響應(yīng)式網(wǎng)頁設(shè)計等建站業(yè)務(wù),價格優(yōu)惠性價比高,為龍勝等各大城市提供網(wǎng)站開發(fā)制作服務(wù)。

2、所有的oracle段(segments,在此,為了理解方便,建議把segment作為表的一個同義詞) 都有一個在段內(nèi)容納數(shù)據(jù)的上限,我們把這個上限稱為high water mark或HWM。這個HWM是一個標(biāo)記,用來說明已經(jīng)有多少沒有使用的數(shù)據(jù)塊分配給這個segment。

oracle 如何查看表 高水位線

select blocks, empty_blocks from dba_tables where table_name='xxx' and owner='xx';

blocks就是已經(jīng)分配的空間即HWM,實際分配的空間,不是實際大小

如何看懂ORACLE執(zhí)行計劃

一、什么是執(zhí)行計劃

An explain plan is a representation of the access path that is taken when a query is executed within Oracle.

二、如何訪問數(shù)據(jù)

At the physical level Oracle reads blocks of data. The smallest amount of data read is a single Oracle block, the largest is constrained by operating system limits (and multiblock i/o). Logically Oracle finds the data to read by using the following methods:

Full Table Scan (FTS) --全表掃描

Index Lookup (unique non-unique) --索引掃描(唯一和非唯一)

Rowid --物理行id

三、執(zhí)行計劃層次關(guān)系

When looking at a plan, the rightmost (ie most inndented) uppermost operation is the first thing that is executed. --采用最右最上最先執(zhí)行的原則看層次關(guān)系,在同一級如果某個動作沒有子ID就最先執(zhí)行

1.一個簡單的例子:

SQL select /*+parallel (e 4)*/ * from emp e;

Execution Plan

----------------------------------------------------------

0 SELECT STATEMENT Optimizer=CHOOSE (Cost=1 Card=82 Bytes=7134)

1 0 TABLE ACCESS* (FULL) OF 'EMP' (Cost=1 Card=82 Bytes=7134):Q5000

--[:Q5000]表示是并行方式

1 PARALLEL_TO_SERIAL SELECT /*+ NO_EXPAND ROWID(A1) */ A1."EMPNO"

,A1."ENAME",A1."JOB",A1."MGR",A1."HI

優(yōu)化模式是CHOOSE的情況下,看Cost參數(shù)是否有值來決定采用CBO還是RBO:

SELECT STATEMENT [CHOOSE] Cost=1234--Cost有值,采用CBO

SELECT STATEMENT [CHOOSE] --Cost為空,采用RBO(9I是如此顯示的)

2.層次的父子關(guān)系的例子:

PARENT1

**FIRST CHILD

****FIRST GRANDCHILD

**SECOND CHILD

Here the same principles apply, the FIRST GRANDCHILD is the initial operation then the FIRST CHILD followed by the SECOND CHILD and finally the PARENT collates the output.

四、例子解說

Execution Plan

----------------------------------------------------------

0 **SELECT STATEMENT Optimizer=CHOOSE (Cost=3 Card=8 Bytes=248)

1 0 **HASH JOIN (Cost=3 Card=8 Bytes=248)

2 1 ****TABLE ACCESS (FULL) OF 'DEPT' (Cost=1 Card=3 Bytes=36)

3 1 ****TABLE ACCESS (FULL) OF 'EMP' (Cost=1 Card=16 Bytes=304)

左側(cè)的兩排數(shù)據(jù),前面的是序列號ID,后面的是對應(yīng)的PID(父ID)。

A shortened summary of this is:

Execution starts with ID=0: SELECT STATEMENT but this is dependand on it's child objects

So it executes its first child step: ID=1 PID=0 HASH JOIN but this is dependand on it's child objects

So it executes its first child step: ID=2 PID=1 TABLE ACCESS (FULL) OF 'DEPT'

Then the second child step: ID=3 PID=2 TABLE ACCESS (FULL) OF 'EMP'

Rows are returned to the parent step(s) until finished

五、表訪問方式

1.Full Table Scan (FTS) 全表掃描

In a FTS operation, the whole table is read up to the high water mark (HWM). The HWM marks the last block in the table that has ever had data written to it. If you have deleted all the rows then you will still read up to the HWM. Truncate resets the HWM back to the start of the table. FTS uses multiblock i/o to read the blocks from disk. --全表掃描模式下會讀數(shù)據(jù)到表的高水位線(HWM即表示表曾經(jīng)擴展的最后一個數(shù)據(jù)塊),讀取速度依賴于Oracle初始化參數(shù)db_block_multiblock_read_count(我覺得應(yīng)該這樣翻譯:FTS掃描會使表使用上升到高水位(HWM),HWM標(biāo)識了表最后寫入數(shù)據(jù)的塊,如果你用DELETE刪除了所有的數(shù)據(jù)表仍然處于高水位(HWM),只有用TRUNCATE才能使表回歸,FTS使用多IO從磁盤讀取數(shù)據(jù)塊).

Query Plan

------------------------------------

SELECT STATEMENT [CHOOSE] Cost=1

**INDEX UNIQUE SCAN EMP_I1 --如果索引里就找到了所要的數(shù)據(jù),就不會再去訪問表

2.Index Lookup 索引掃描

There are 5 methods of index lookup:

index unique scan --索引唯一掃描

Method for looking up a single key value via a unique index. always returns a single value, You must supply AT LEAST the leading column of the index to access data via the index.

eg:SQL explain plan for select empno,ename from emp where empno=10;

index range scan --索引局部掃描

Index range scan is a method for accessing a range values of a particular column. AT LEAST the leading column of the index must be supplied to access data via the index. Can be used for range operations (e.g. = = between) .

eg:SQL explain plan for select mgr from emp where mgr = 5;

index full scan --索引全局掃描

Full index scans are only available in the CBO as otherwise we are unable to determine whether a full scan would be a good idea or not. We choose an index Full Scan when we have statistics that indicate that it is going to be more efficient than a Full table scan and a sort. For example we may do a Full index scan when we do an unbounded scan of an index and want the data to be ordered in the index order.

eg: SQL explain plan for select empno,ename from big_emp order by empno,ename;

index fast full scan --索引快速全局掃描,不帶order by情況下常發(fā)生

Scans all the block in the index, Rows are not returned in sorted order, Introduced in 7.3 and requires V733_PLANS_ENABLED=TRUE and CBO, may be hinted using INDEX_FFS hint, uses multiblock i/o, can be executed in parallel, can be used to access second column of concatenated indexes. This is because we are selecting all of the index.

eg: SQL explain plan for select empno,ename from big_emp;

index skip scan --索引跳躍掃描,where條件列是非索引的前導(dǎo)列情況下常發(fā)生

Index skip scan finds rows even if the column is not the leading column of a concatenated index. It skips the first column(s) during the search.

eg:SQL create index i_emp on emp(empno, ename);

SQL select /*+ index_ss(emp i_emp)*/ job from emp where ename='SMITH';

3.Rowid 物理ID掃描

This is the quickest access method available.Oracle retrieves the specified block and extracts the rows it is interested in. --Rowid掃描是最快的訪問數(shù)據(jù)方式

很精辟的oracle高水位線,終于知道DELETE和TRUNCATE為什么不一樣

兩個操作都是刪除表數(shù)據(jù)的但是實際卻又很大的不同

delete只是單純的刪掉表里的數(shù)據(jù),他可以添加刪除條件,但是不會將空間回收,刪除的時候有記錄日志,方便恢復(fù),但是速度比較慢

truncate table是全表清空的操作,回收空間,無日志,基本上是不可恢復(fù)的

文章名稱:oracle水位線怎么看,oracle 高水位線查詢
文章出自:http://chinadenli.net/article0/hecpoo.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供域名注冊網(wǎng)站制作網(wǎng)站收錄動態(tài)網(wǎng)站網(wǎng)頁設(shè)計公司企業(yè)建站

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

成都定制網(wǎng)站網(wǎng)頁設(shè)計