Oracle全文索引的性能优势实例(2)

1 SQL> create table t_bmap as select * from dba_objects;
2
3 Table created.
4 SQL> create bitmap index ind_bmap on t_bmap(object_name);
5
6 Index created。

执行之前的同样的语句查询:

SQL> select count(*) from t_bmap where t_bmap.object_name like '%ObjectStreamClass%';

COUNT(*)
----------
    84


Execution Plan
----------------------------------------------------------
Plan hash value: 891302759

------------------------------------------------------------------------------------------
| Id  | Operation              | Name    | Rows  | Bytes | Cost (%CPU)| Time    |
------------------------------------------------------------------------------------------
|  0 | SELECT STATEMENT          |      |    1 |    66 |  263  (0)| 00:00:04 |
|  1 |  SORT AGGREGATE          |      |    1 |    66 |          |      |
|  2 |  BITMAP CONVERSION COUNT    |      |    12 |  792 |  263  (0)| 00:00:04 |
|*  3 |    BITMAP INDEX FAST FULL SCAN| IND_BMAP |    |    |          |      |
------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

3 - filter("T_BMAP"."OBJECT_NAME" IS NOT NULL AND "T_BMAP"."OBJECT_NAME" LIKE
          '%ObjectStreamClass%')

Note
-----
  - dynamic sampling used for this statement (level=2)


Statistics
----------------------------------------------------------
    28  recursive calls
      0  db block gets
    360  consistent gets
    591  physical reads
      0  redo size
    422  bytes sent via SQL*Net to client
    419  bytes received via SQL*Net from client
      2  SQL*Net roundtrips to/from client
      0  sorts (memory)
      0  sorts (disk)
      1  rows processed

SQL> select count(*) from t_bmap where t_bmap.object_name like '%ObjectStreamClass%';

COUNT(*)
----------
    84


Execution Plan
----------------------------------------------------------
Plan hash value: 891302759

------------------------------------------------------------------------------------------
| Id  | Operation              | Name    | Rows  | Bytes | Cost (%CPU)| Time    |
------------------------------------------------------------------------------------------
|  0 | SELECT STATEMENT          |      |    1 |    66 |  263  (0)| 00:00:04 |
|  1 |  SORT AGGREGATE          |      |    1 |    66 |          |      |
|  2 |  BITMAP CONVERSION COUNT    |      |    12 |  792 |  263  (0)| 00:00:04 |
|*  3 |    BITMAP INDEX FAST FULL SCAN| IND_BMAP |    |    |          |      |
------------------------------------------------------------------------------------------

Predicate Information (identified by operation id):
---------------------------------------------------

3 - filter("T_BMAP"."OBJECT_NAME" IS NOT NULL AND "T_BMAP"."OBJECT_NAME" LIKE
          '%ObjectStreamClass%')

Note
-----
  - dynamic sampling used for this statement (level=2)

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:https://www.heiqu.com/6e0e91bf880b279a357b0c9ee87b864d.html