create table weisi_t as select * from dba_objects;
set autotrace on
set timing on
set linesize 200
select * from weisi_t where object_id=10;
create index index_weisi on weisi_t(object_id);
select * from weisi_t where object_id=10;
update weisi_t set object_id=10 where 1=1;
1:索引的分類
? ? 1)btree(balance tree)索引
? ? ? 索引三大特點:高度低、存儲列值市俊、結(jié)構(gòu)有序
? ? 2)位圖索引
? ? 3)函數(shù)索引
2:詳解BTREE索引
? 2.1)BTREE索引的結(jié)構(gòu)和原理
? ? ? ? 原理:索引入口頭部震鹉、列長度、列值闺金、ROWID、
? ? ? ? ? ? ? ROWID:數(shù)據(jù)詳細(xì)地址,通過ROWID快速定位某行具體的數(shù)據(jù)位置凤粗,64(A-Z,a-z,0-9,+,/),A=0考赛,a=27,0=53,+=62,/=63惕澎。
? ? ? ? ? ? ? ? ? ? 六位 data object_id?
? ? ? ? ? ? ? ? ? ? ? ? 不等于object_id
? ? ? ? ? ? ? ? ? ? ? ? select object_id,data_object_id from dba_objects;
? ? ? ? ? ? ? ? ? ? 三位 相對文件號
? ? ? ? ? ? ? ? ? ? ? ? select file#,Rfile#,ts#,name from v$datafile
? ? ? ? ? ? ? ? ? ? 六位 數(shù)據(jù)塊號
? ? ? ? ? ? ? ? ? ? ? ? 范圍:數(shù)據(jù)文件
? ? ? ? ? ? ? ? ? ? 三位 行號
? ? ? ? ? ? ? rowid轉(zhuǎn)化為文件號和塊號? ? ?
? ? ? ? ? ? ? select
? ? ? ? ? ? ? ? ? dbms_rowid.rowid_object('AAASUVAABAAAU8LAAl') object,
? ? ? ? ? ? ? ? ? dbms_rowid.rowid_relative_fno('AAASUVAABAAAU8LAAl') file_num,
? ? ? ? ? ? ? ? ? dbms_rowid.rowid_block_number('AAASUVAABAAAU8LAAl') block_num,
? ? ? ? ? ? ? ? ? dbms_rowid.rowid_row_number('AAASUVAABAAAU8LAAl') row_number
? ? ? ? ? ? ? from dual;?
? ? ? ? 從ROWID推出各種的ORACLE數(shù)據(jù)限制? ? ? ? ? ? ? ? ?
? ? ? ? ROWID:以64位編碼顯示,但是以二進(jìn)制的方式存儲
? ? ? ? ? ? ? ? rowid用10個字節(jié)存儲颜骤,即80bit
? ? ? ? ? ? ? ? 32bit data_object_id? 4G個對象
? ? ? ? ? ? ? ? 10bit 相對文件號? ? ? 一個表空間最多只有1023個文件唧喉,不是1024,因為沒有O文件號
? ? ? ? ? ? ? ? 22bit 塊號? ? ? ? ? ? 一個數(shù)據(jù)文件最大4M個BLOCK塊 及32G
? ? ? ? ? ? ? ? 16bit 行號? ? ? ? ? ? 64K行數(shù)據(jù)
? ? ? ? ? ? ? alter system dump datafile 1 block 85771;
? ? ? ? ? ? ? select file#,Rfile#,ts#,name from v$datafile
? ? ? ? ? ? ? select spid from v$process where addr in (select paddr from v$session where
? ? ? ? ? ? sid=(select sid from v$mystat where rownum=1));
? ? ? ? ? ? ? show parameter dump
? ? ? ? ? ? ? select object_name,dump(object_name,1018) from weisi_t where object_id=222;
? ? ? ? ? ? ? select rowid,id,code,name,dump(name,1018) from characterset_test;
? ? ? ? ? ? ? AAASDEAABAAAVUxAAB
? ? ? ? ? ? ? ? select
? ? ? ? ? ? ? ? ? dbms_rowid.rowid_object('AAASDEAABAAAVUxAAB') object,
? ? ? ? ? ? ? ? ? dbms_rowid.rowid_relative_fno('AAASDEAABAAAVUxAAB') file_num,
? ? ? ? ? ? ? ? ? dbms_rowid.rowid_block_number('AAASDEAABAAAVUxAAB') block_num ,
? ? ? ? ? ? ? ? ? dbms_rowid.rowid_row_number('AAASDEAABAAAVUxAAB') row_number
? ? ? ? ? ? ? from dual;
? ? ? ? ? ? ? ? ? alter system dump datafile 1 block 87345;
? ? ? ? ? ? ? ? select spid from v$process where addr in (select paddr from v$session where
? ? ? ? ? ? ? sid=(select sid from v$mystat where rownum=1));
? ? ? ? select object_type from dba_objects group by object_type order by 1;
? ? ? ? select * from dba_index
? ? ? 2.2)索引結(jié)構(gòu)
? ? ? ? ? ? 索引是物理結(jié)構(gòu)還是邏輯結(jié)構(gòu)忍抽?
? ? ? 2.3)索引的三大特性
? ? ? ? ? ? 1:索引高度低
? ? ? ? ? ? ? 2.3.1.1)構(gòu)建大表和普通表
? ? ? ? ? ? ? create table normal_t as select * from dba_objects;
? ? ? ? ? ? ? create table normal_t_100 as select * from dba_objects where rownum< 100;
? ? ? ? ? ? ? create table big_t as select * from dba_objects;
? ? ? ? ? ? ? insert into big_t select * from big_t;
? ? ? ? ? ? ? insert into big_t select * from big_t;
? ? ? ? ? ? ? insert into big_t select * from big_t;
? ? ? ? ? ? ? insert into big_t select * from big_t;
? ? ? ? ? ? ? insert into big_t select * from big_t;
? ? ? ? ? ? ? insert into big_t select * from big_t;
? ? ? ? ? ? ? insert into big_t select * from big_t;
? ? ? ? ? ? ? select count(1) from big_t;
? ? ? ? ? ? ? 2.3.1.2)創(chuàng)建索引
? ? ? ? ? ? ? ? create index big_t_index on big_t(object_id);
? ? ? ? ? ? ? ? create index normal_index on normal_t(object_id);
? ? ? ? ? ? ? ? create index normal_t_100_index on normal_t_100(object_id);
? ? ? ? ? ? ? ? select segment_name,sum(bytes)/1024/1024 M from user_segments
? ? ? ? ? ? ? ? where segment_name in ('BIG_T_INDEX','NORMAL_INDEX','NORMAL_T_100_INDEX')group by segment_name;
? ? ? ? ? ? ? 2.3.1.3) 查看索引高度
? ? ? ? ? ? ? col index_name format a40
? ? ? ? ? ? ? set linesize 150
? ? ? ? ? ? ? select?
? ? ? ? ? ? ? ? ? ? ? index_name
? ? ? ? ? ? ? ? ? ? ? ,blevel
? ? ? ? ? ? ? ? ? ? ? ,leaf_blocks
? ? ? ? ? ? ? ? ? ? ? ,num_rows
? ? ? ? ? ? ? ? ? ? ? ,distinct_keys
? ? ? ? ? ? ? from user_ind_statistics
? ? ? ? ? ? ? where table_name? in ('BIG_T','NORMAL_T','NORMAL_T_100');? ?
? ? ? ? ? ? ? 2.3.1.4) 索引是性能提升利器
? ? ? ? ? ? ? ? cat $ORACLE_HOME/sqlplus/admin/plustrce.sql
? ? ? ? ? ? ? ? sqlplus / as sysdba
? ? ? ? ? ? ? ? @$ORACLE_HOME/sqlplus/admin/plustrce.sql
? ? ? ? ? ? ? ? grant plustrace to weisi;
? ? ? ? ? ? ? ? set autotrace on
? ? ? ? ? ? ? ? set linesize 200
? ? ? ? ? ? ? ? set timing on
? ? ? ? ? ? ? ? select * from big_t where object_id=111;
? ? ? ? ? ? ? ? create index big_t_index on big_t(object_id);
? ? ? ? ? ? ? ? select * from big_t where object_id=111;
? ? ? ? ? ? ? ? select * from normal_t where object_id=111;
? ? ? ? ? ? ? ? select * from normal_t_100 where object_id=111;
? ? ? ? ? ? ? ? 2.3.1.5) 分區(qū)索引(誤區(qū))
? ? ? ? ? ? ? ? ? 分區(qū)索引:全局索引和局部索引
? ? ? ? ? ? ? ? ? 分區(qū)條件和索引不同字段
? ? ? ? ? ? ? ? ? create table part_t
? ? ? ? ? ? ? ? ? ? ? ? partition by range(object_id)
? ? ? ? ? ? ? ? ? ? ? ? (
? ? ? ? ? ? ? ? ? ? ? ? ? partition p1 values less than (10000),
? ? ? ? ? ? ? ? ? ? ? ? ? partition p2 values less than (20000),
? ? ? ? ? ? ? ? ? ? ? ? ? partition p3 values less than (30000),
? ? ? ? ? ? ? ? ? ? ? ? ? partition p4 values less than (40000),
? ? ? ? ? ? ? ? ? ? ? ? ? partition p5 values less than (50000),
? ? ? ? ? ? ? ? ? ? ? ? ? partition p6 values less than (60000),
? ? ? ? ? ? ? ? ? ? ? ? ? partition p7 values less than (70000),
? ? ? ? ? ? ? ? ? ? ? ? ? partition p_max values less than (maxvalue)
? ? ? ? ? ? ? ? ? ? ? ? ? )
? ? ? ? ? ? ? ? ? ? ? ? ? as select * from dba_objects;
? ? ? ? ? ? ? ? ? ? create index part_t_local on part_t(data_object_id) local;
? ? ? ? ? ? ? ? ? create table part_t1
? ? ? ? ? ? ? ? ? ? ? ? partition by range(object_id)
? ? ? ? ? ? ? ? ? ? ? ? (
? ? ? ? ? ? ? ? ? ? ? ? ? partition p1 values less than (10000),
? ? ? ? ? ? ? ? ? ? ? ? ? partition p2 values less than (20000),
? ? ? ? ? ? ? ? ? ? ? ? ? partition p3 values less than (30000),
? ? ? ? ? ? ? ? ? ? ? ? ? partition p4 values less than (40000),
? ? ? ? ? ? ? ? ? ? ? ? ? partition p5 values less than (50000),
? ? ? ? ? ? ? ? ? ? ? ? ? partition p6 values less than (60000),
? ? ? ? ? ? ? ? ? ? ? ? ? partition p7 values less than (70000),
? ? ? ? ? ? ? ? ? ? ? ? ? partition p_max values less than (maxvalue)
? ? ? ? ? ? ? ? ? ? ? ? ? )
? ? ? ? ? ? ? ? ? ? ? ? ? as select * from dba_objects;
? ? ? ? ? ? ? ? ? create index part_t1_index on part_t1(data_object_id);? ? ? ?
? ? ? ? ? ? col segment_name format a25
? ? ? ? ? ? col partition_name format a25
? ? ? ? ? ? col segment_type format a25
? ? ? ? ? ? set linesize 200?
? ? ? ? ? ? select segment_name,partition_name,segment_type
? ? ? ? ? ? from user_segments
? ? ? ? ? ? where segment_name in ('PART_T','PART_T1','PART_T_LOCAL','PART_T1_INDEX');
? ? ? ? ? ? set autotrace traceonly
? ? ? ? ? ? set linesize 200
? ? ? ? ? ? select * from part_t where data_object_id=222 ;
? ? ? ? ? ? select * from part_t1 where data_object_id=222;
? ? ? ? ? ? select * from part_t where data_object_id=222 and object_id=10;
? ? ? ? ? ? select * from part_t1 where data_object_id=222 and object_id=10;
? ? ? ? ? ? create index normal_t_index on normal_t(data_object_id);
? ? ? ? ? ? select * from normal_t where data_object_id=222;
? ? ? ? ? ? --查看索引高度
? ? ? ? ? ? ? col index_name format a40
? ? ? ? ? ? ? set linesize 150
? ? ? ? ? ? ? select?
? ? ? ? ? ? ? ? ? ? ? index_name
? ? ? ? ? ? ? ? ? ? ? ,blevel
? ? ? ? ? ? ? ? ? ? ? ,leaf_blocks
? ? ? ? ? ? ? ? ? ? ? ,num_rows
? ? ? ? ? ? ? ? ? ? ? ,distinct_keys
? ? ? ? ? ? ? from user_ind_statistics
? ? ? ? ? ? ? where table_name? in ('PART_T','PART_T1','NORMAL_T')
? ? ? ? ? ? ? order by index_name;
? ? ? ? ? ? 修改意見:加上分區(qū)條件
? ? ? ? ? ? ? select * from part_t where data_object_id=222 and object_id=222;
? ? ? ? ? ? 2:索引存儲列值
? ? ? ? ? ? ? drop index normal_t_index;
? ? ? ? ? ? ? drop table normal_t;
? ? ? ? ? ? ? create table normal_t as select * from dba_objects;
? ? ? ? ? ? ? 1.count(*)優(yōu)化
? ? ? ? ? ? ? ? set autotrace traceonly
? ? ? ? ? ? ? ? set linesize 200
? ? ? ? ? ? ? ? select count(*) from normal_t;
? ? ? ? ? ? ? ? create index normal_t_index on normal_t(object_id);
? ? ? ? ? ? ? ? select count(*) from normal_t;
? ? ? ? ? ? ? ? select count(*) from normal_t where object_id is not null;
? ? ? ? ? ? ? ? drop table normal_t;
? ? ? ? ? ? ? ? create table normal_t as select * from dba_objects where 1=2;
? ? ? ? ? ? ? ? alter table normal_t modify object_id not null;
? ? ? ? ? ? ? ? insert into normal_t select * from dba_objects;
? ? ? ? ? ? ? ? select count(*) from normal_t;
? ? ? ? ? ? ? ? 任何情況下八孝,使用索引一定比全表掃描塊嗎?
? ? ? ? ? ? ? ? select * from normal_t;
? ? ? ? ? ? ? ? select /*+ index(NORMAL_T_INDEX) */? * from NORMAL_T where object is not null;
? ? ? ? ? ? ? 2.avg問題
? ? ? ? ? ? ? drop index normal_t_index;
? ? ? ? ? ? ? drop table normal_t;
? ? ? ? ? ? ? create table normal_t as select * from dba_objects;
? ? ? ? ? ? ? set autotrace traceonly
? ? ? ? ? ? ? set linesize 200
? ? ? ? ? ? ? select avg(object_id) from normal_t;
? ? ? ? ? ? ? create index normal_t_index on normal_t(object_id);
? ? ? ? ? ? ? select avg(object_id) from normal_t;
? ? ? ? ? ? 3:索引本身是有序
? ? ? ? ? ? ? drop index normal_t_index;
? ? ? ? ? ? ? drop table normal_t;
? ? ? ? ? ? ? create table normal_t as select * from dba_objects;
? ? ? ? ? ? ? 3.1)min/max優(yōu)化
? ? ? ? ? ? ? ? ? ? set autotrace on
? ? ? ? ? ? ? ? ? ? set linesize 200
? ? ? ? ? ? ? ? ? ? create index normal_t_index on normal_t(object_id);
? ? ? ? ? ? ? ? ? ? select min(object_id) from normal_t;
? ? ? ? ? ? ? ? ? ? select max(object_id) from normal_t;
? ? ? ? ? ? ? ? ? ? 為什么是兩次一致性讀鸠项??
? ? ? ? ? ? ? ? ? ? select count(*) from normal_t;
? ? ? ? ? ? ? ? ? ? 如果NORMAL_T表干跛,記錄增加100倍,MIN,MAX的邏輯讀是否會大量增加祟绊?
? ? ? ? ? ? ? select?
? ? ? ? ? ? ? ? ? ? ? index_name
? ? ? ? ? ? ? ? ? ? ? ,blevel
? ? ? ? ? ? ? ? ? ? ? ,leaf_blocks
? ? ? ? ? ? ? ? ? ? ? ,num_rows
? ? ? ? ? ? ? ? ? ? ? ,distinct_keys
? ? ? ? ? ? ? from user_ind_statistics
? ? ? ? ? ? ? where table_name='NORMAL_T';
? ? ? ? ? ? ? 3.2)min/max性能陷阱:INDEX FAST FULL SCAN楼入,INDEX FULL SCAN (MIN/MAX)
? ? ? ? ? ? ? ? ? ? select min(object_id),max(object_id) from normal_t;--是否能用到索引
? ? ? ? ? ? ? ? ? ? select min(object_id),max(object_id) from normal_t where object_id is not null;
? ? ? ? ? ? ? ? ? ? select min(object_id),max(object_id) from normal_t是否等價于
? ? ? ? ? ? ? ? ? ? select min(object_id) from normal_t;
? ? ? ? ? ? ? ? ? ? select max(object_id) from normal_t;
? ? ? ? ? ? ? ? ? ? select min,max from (select min(object_id) min from normal_t) a,(select max(object_id) max from normal_t) b;jianli
? ? ? ? ? ? ? 3.3)order by 優(yōu)化
? ? ? ? ? ? ? ? ? ? drop index normal_t_index;
? ? ? ? ? ? ? ? ? ? drop table normal_t;
? ? ? ? ? ? ? ? ? ? create table normal_t as select * from dba_objects;
? ? ? ? ? ? ? ? ? ? set autotrace traceonly
? ? ? ? ? ? ? ? ? ? set linesize 200
? ? ? ? ? ? ? ? ? ? select * from normal_t where object_id<70000;
? ? ? ? ? ? ? ? ? ? select * from normal_t where object_id<70000 order by object_id;
? ? ? ? ? ? ? ? ? ? 1:無ORDER BY 語句沒有排序,ORDER BY 語句有排序久免,1? sorts (memory)
? ? ? ? ? ? ? ? ? ? 2:無ORDER BY 的語句COST 290浅辙,完成時間4秒,ORDER BY 語句3250 阎姥,完成時間40秒
? ? ? ? ? ? ? ? ? ? 3:無ORDER BY 的一致讀5555,ORDER BY 一致讀1038 记舆,有排序的比沒排序的一致讀少
? ? ? ? ? ? ? ? ? ? ? ? 一致性讀的多運行時間少,一致性讀的少呼巴,運行時間長泽腮,SQL運行長短看COST值御蒲,不看一致性讀
? ? ? ? ? ? ? ? ? ? ? ? COST值越小性能越高,ORACLE執(zhí)行計劃選擇是由COST值決定的诊赊。
? ? ? ? ? ? ? ? ? ? 4:排序需要消耗大量的性能
? ? ? ? ? ? ? ? ? ? 優(yōu)化方法:
? ? ? ? ? ? ? ? ? ? ? ? create index normal_t_index on normal_t(object_id);? ?
? ? ? ? ? ? ? ? ? ? ? ? select * from normal_t where object_id<70000 order by object_id;
? ? ? ? ? ? ? ? ? ? ? ? select * from big_t where object_id<70000 order by object_id;
? ? ? ? ? ? ? 4 索引回表優(yōu)化
? ? ? ? ? ? ? ? 4.1) 索引回表讀 TABLE ACCESS BY INDEX ROWID
? ? ? ? ? ? ? ? ? ? drop index normal_t_index;
? ? ? ? ? ? ? ? ? ? drop table normal_t;
? ? ? ? ? ? ? ? ? ? create table normal_t as select * from dba_objects;
? ? ? ? ? ? ? ? ? ? create index normal_t_index on normal_t(object_id);
? ? ? ? ? ? ? ? ? ? set autotrace on
? ? ? ? ? ? ? ? ? ? set linesize 200
? ? ? ? ? ? ? ? ? ? select * from? normal_t where object_id< 100;? ?
? ? ? ? ? ? ? ? ? ? TABLE ACCESS BY INDEX ROWID
? ? ? ? ? ? ? ? ? ? select object_id from normal_t where object_id<100;
? ? ? ? ? ? ? ? ? ? 無TABLE ACCESS BY INDEX ROWID
? ? ? ? ? ? ? ? ? ? 解決方法:1:改變SQL寫法厚满,只取需要的數(shù)據(jù)
? ? ? ? ? ? ? ? ? ? ? ? ? ? ? 2:建立聯(lián)合索引,聯(lián)合索引盡量不超過三個字段
? ? ? ? ? ? ? ? ? ? select object_name,object_id from normal_t where object_id<100;
? ? ? ? ? ? ? ? ? ? create index normal_t_index_2 on normal_t(object_name,object_id);
? ? ? ? ? ? ? ? ? ? select object_name,object_id from normal_t where object_id<100;
? ? ? ? ? ? ? ? ? ? create index normal_t_index_3 on normal_t(object_id,object_name);
? ? ? ? ? ? 5 聯(lián)合索引
? ? ? ? ? ? ? set autotrace on
? ? ? ? ? ? ? set linesize 200
? ? ? ? ? ? ? create table normal_t as select * from dba_objects;
? ? ? ? ? ? ? create index normal_t_index on normal_t(object_id);
? ? ? ? ? ? ? select object_name from normal_t where object_id=100;
? ? ? ? ? ? ? create index normal_t_index_2 on normal_t(object_name,object_id);
? ? ? ? ? ? ? select object_name from normal_t where object_id=100;
? ? ? ? ? ? ? create index normal_t_index_2 on normal_t(object_id,object_name);?
? ? ? ? ? ? ? select object_name from normal_t where object_id=100;
? ? ? ? ? ? 6 索引監(jiān)控
? ? ? ? ? ? ? select * from v$object_usage;
? ? ? ? ? ? ? select object_name from big_t where object_id=100;
? ? ? ? ? ? ? select * from v$object_usage;
? ? ? ? ? ? ? alter index big_t_index monitoring usage;
? ? ? ? ? ? ? alter index big_t_index nomonitoring usage;
? ? ? ? ? ? ? select object_name from big_t where object_id=100;
? ? ? ? ? ? ? select * from v$object_usage;
? ? ? ? ? ? 6 建立索引引發(fā)的問題
? ? ? ? ? ? ? 1) 排序
? ? ? ? ? ? ? 2)鎖?
? ? ? ? ? ? ? ? ? create index big_t_index on big_t(object_id);
? ? ? ? ? ? ? ? ? select sid from v$mystat where rownum=1;
? ? ? ? ? ? ? ? ? select * from v$lock where sid=23
? ? ? ? ? ? ? ? ? update big_t set object_id=100 where object_id=10;
? ? ? ? ? ? ? ? ? select sid,type,id1,id2,
decode(lmode,0,'None',1,'Null',2,'Row share',3,'Row Exclusive',4,'Share',5,'Share Row Exclusive',6,'Exclusive') lock_mode,
decode(request,0,'None',1,'Null',2,'Row share',3,'Row Exclusive',4,'Share',5,'Share Row Exclusive',6,'Exclusive')
request_mode,block
from v$lock
? ? ? ? ? ? 6 索引的危害影響
? ? ? ? ? ? ? drop index normal_t_index;
? ? ? ? ? ? ? drop table normal_t;
? ? ? ? ? ? ? create table normal_t as select * from dba_objects where 1=2;
? ? ? ? ? ? ? set timing on
? ? ? ? ? ? ? insert into normal_t select * from dba_objects ;
? ? ? ? ? ? ? create index normal_t_index on normal_t(object_id);
? ? ? ? ? ? ? insert into normal_t select * from dba_objects ;
? ? ? ? ? ? ? 先刪除索引碧磅,再插入碘箍,最后在重建索引
? ? ? ? ? ? ? DML語句對索引的影響
? ? ? ? ? ? ? 1) insert into
? ? ? ? ? ? ? 2) delete
? ? ? ? ? ? ? 3) update
3:位圖索引
? ? ? ? ? set autotrace on
? ? ? ? ? alter table big_t modify object_id not null;
? ? ? ? ? select count(1) from big_t;
? ? ? ? ? create bitmap index index_batmap_t_status on big_t(object_type);
? ? ? ? ? select * from dba_indexes where table_name='BIG_T';
? ? ? ? ? select count(1) from big_t;
? ? ? ? ? select object_type,count(1) from big_t group by object_type;?
? ? ? ? ? select object_id,count(1) from big_t group by object_id;
? ? ? ? ? 插入
? ? ? ? ? SESSION 1 插入
? ? ? ? ? insert into big_t select * from dba_objects;
? ? ? ? ? session 2 插入
? ? ? ? ? insert into big_t select * from dba_objects;
? ? ? ? ? 位圖索引試用場合
? ? ? ? ? 1:位圖索引列大量重復(fù)
? ? ? ? ? 2:表極少更新
? ? ? ? ? 1)位圖索引列重復(fù)情況少
? ? ? ? ? ? ? create table normal_t as select * from dba_objects;
? ? ? ? ? ? ? create bitmap index index_batmap_t_object_id on normal_t(object_id);
? ? ? ? ? ? ? set autotrace on
? ? ? ? ? ? ? select /* +full(normal_t)*/count(1) from normal_t;
? ? ? ? ? ? ? select /* +index(index_batmap_t_object_id)*/count(1) from normal_t;