Chat now with support
Chat mit Support

SQL Optimizer for Oracle 10.0 - User Guide

Welcome to SQL Optimizer
About SQL Optimizer SQL Optimization Workflow New in This Release Additional Resources Database Privileges Database Privileges Script Connect to the Database Windows Layout Customize Toolbars Keyboard Shortcuts Support Bundle Register SQL Optimizer Check for Updates SQL Operations
ALL PARTITION ALTER INDEX AND EQUAL ANTI JOIN BITMAP AND BITMAP COMPACTION BITMAP CONSTRUCTION BITMAP CONVERSION BITMAP INDEX BITMAP JOIN INDEX UPDATE BITMAP JOIN INDEX UPDATE STATEMENT BITMAP KEY ITERATION BITMAP MERGE BITMAP MINUS BITMAP OR BUFFER SORT CARTESIAN JOIN COLLECTION ITERATOR CONCATENATION CONNECT BY CONNECT BY PUMP COUNT COUNT STOPKEY CREATE AS SELECT CUBE SCAN DDL STATEMENT DELETE DOMAIN INDEX FAST FULL INDEX SCAN FILTER FIRST ROWS FIXED INDEX FIXED TABLE FOR UPDATE FULL INDEX SCAN FULL INDEX SCAN DESCENDING FULL INDEX SCAN (MIN/MAX) HASH GROUP BY HASH GROUP BY PIVOT HASH JOIN HASH JOIN BUFFERED HASH PARTITION HASH UNIQUE INDEX INDEX BUILD NON UNIQUE INDEX RANGE SCAN INDEX RANGE SCAN DESCENDING INDEX RANGE SCAN (MIN/MAX) INDEX SAMPLE FAST FULL SCAN INDEX SKIP SCAN INDEX SKIP SCAN DESCENDING INDEX UNIQUE SCAN INLIST ITERATOR INLIST PARTITION INSERT INTERSECTION INTO INVALID PARTITION ITERATOR PARTITION LOAD AS SELECT MAT_VIEW ACCESS MAT_VIEW REWRITE ACCESS MERGE JOIN MINUS MULTI-TABLE INSERT NESTED LOOPS OUTER JOIN PARTITION PARTITION HASH EMPTY PARTITION LIST PARTITION RANGE PROJECTION PX BLOCK ITERATOR PX COORDINATOR PX ITERATOR PX PARTITION PX PARTITION HASH ALL PX PARTITION LIST ALL PX PARTITION RANGE ALL PX RECEIVE PX SEND RANGE PARTITION RECURSIVE EXECUTION RECURSIVE WITH PUMP REFERENCE MODEL REMOTE SELECT SEMI JOIN SEQUENCE SINGLE PARTITION SINGLE RANGE PARTITION SORT SORT AGGREGATE SORT GROUP BY SORT GROUP BY CUBE SORT GROUP BY NOSORT SORT GROUP BY ROLLUP SORT JOIN SORT ORDER BY SORT UNIQUE SQL MODEL TABLE ACCESS TABLE ACCESS BY GLOBAL INDEX ROWID TABLE ACCESS BY INDEX ROWID TABLE ACCESS BY LOCAL INDEX ROWID TABLE ACCESS BY ROWID TABLE ACCESS BY USER ROWID TABLE ACCESS CLUSTER TABLE ACCESS FULL TABLE ACCESS HASH TABLE ACCESS SAMPLE TABLE QUEUE TEMP TABLE GENERATION TEMP TABLE TRANSFORMATION UNION UNION ALL UNION ALL (RECURSIVE WITH) UNPIVOT UPDATE VIEW VIEW PUSHED PREDICATE WINDOW
Optimize SQL
Create Optimize SQL Sessions Open Optimizer SQL Sessions Rewrite SQL Generate Execution Plan Alternatives
Optimize Indexes Batch Optimize SQL Scan SQL Inspect SGA Analyze Impact Manage Plans Configure Options SQL Optimizer Tutorials About Us Legal Notices

BITMAP COMPACTION

 

The BITMAP COMPACTION operation compacts a bitmap index.

 

  

 

BITMAP CONSTRUCTION

 

The BITMAP CONSTRUCTION operation converts column values to a bitmap.

 

  

 

BITMAP CONVERSION

Execution Plan image: image\Plan_Bitmap_Conversion.gif

Row operation.

A bitmap index contains a set of bits that indicate which row contains a certain value. For example, if the first row and the second row in the COMPANY both have a state value of 'MD', then there is a bitmap for the value 'MD'. The bitmap has the first and the second bits set to 1. If the first two rows are the only companies with a state value of 'MD', there will be no more 1 bits in the 'MD' bitmap. When Oracle needs to access the actual rows, the relative location of the row is not sufficient information to provide direct location in the table. For accessing the rows in the table, Oracle needs to convert the relative location stored in the bitmap index to ROWID; only then can Oracle access the table. The process of converting a bitmap value to a ROWID occurs via a BITMAP CONVERSION operation.

Example of BITMAP CONVERSION to ROWID

Assume that both City and State columns each has a single-column bitmap index.

select Name, City, State
from COMPANY
where City = 'Roanoke'
and State = 'VA';

The query shown in the preceding listing selects rows from the COMPANY table for all companies in Roanoke, VA.

Execution Plan

TABLE ACCESS (BY INDEX ROWID) OF 'COMPANY'
BITMAP CONVERSION (TO ROWIDS)
BITMAP AND
  BITMAP INDEX (SINGLE VALUE) OF 'COMPANY$STATE'
  BITMAP INDEX (SINGLE VALUE) OF 'COMPANY$CITY'

Interpreting the Execution Plan

The plan shows that the bitmap index on the City column is used to find a bitmap for all the rows in the COMPANY table that satisfy the where clause condition (where City='Roanoke'). Another bitmap is created from the index on the State column. The two bitmaps are then united to one bitmap using a BITMAP AND operation. The resulting bitmap is converted to a list of ROWIDs via the BITMAP CONVERSION operation. The resulting list of ROWIDs is used as the basis for an access of the COMPANY table.

Example of BITMAP CONVERSION with Counting

Assume that both City and State columns each has a single-column bitmap index.

select COUNT(*)
from COMPANY
where City = 'Roanoke'
and State = 'VA';

The query shown in the preceding listing selects the count of rows from the COMPANY table for all companies in Roanoke, VA.

Execution Plan

SORT (AGGREGATE)
BITMAP CONVERSION (COUNT)
BITMAP AND
BITMAP INDEX (SINGLE VALUE) OF 'COMPANY$CITY'
BITMAP INDEX (SINGLE VALUE) OF 'COMPANY$STATE'

Interpreting the Execution Plan

The plan shows that the bitmap index on the City column is used to find a bitmap for all the rows in the COMPANY table that satisfy the where clause condition (where City='Roanoke'). Another bitmap is created from the index on the State column. The two bitmaps are then united to one bitmap using a BITMAP AND operation. The resulting bitmap is converted to a count. Based on the counts returned, a sort aggregate operation sums the values and returns the output to the user.

 

Related Topics

BITMAP INDEX

Execution Plan image: image\Plan_Bitmap_Index.gif

Row operation.

Bitmap index operations are performed when accessing a bitmap index. The following options are available:

SINGLE VALUE

Accesses a single value in the index and returns a bitmap for all of the matching rows.

Example: Where State = 'MD'

FULL SCAN

A complete scan of the index to find any matching values.

Example: Where State not in ('HI', 'AL')

RANGE SCAN

Accesses a range of values in the index and returns multiple bitmaps. These bitmaps are then merged into one bitmap.

Example: Where City like 'New*'

Example of BITMAP INDEX with SINGLE VALUE option

Assume that both City and State columns each has a single-column bitmap index.

select Name, City, State
from COMPANY
where City = 'Roanoke'
and State = 'VA';

This query selects the count of rows from the COMPANY for all companies in Roanoke, VA.

Execution Plan

TABLE ACCESS (BY INDEX ROWID) OF 'COMPANY'
BITMAP CONVERSION (TO ROWIDS)
BITMAP AND
BITMAP INDEX (SINGLE VALUE) OF 'COMPANY$CITY'
BITMAP INDEX (SINGLE VALUE) OF 'COMPANY$STATE'

Interpreting the Execution Plan

The plan shows that the bitmap index on the City column is used to find a bitmap for all the rows in the COMPANY table that satisfy the WHERE clause condition (where City=’Roanoke’). Another bitmap is created from the index on the State column. The two bitmaps are then united to one bitmap using a BITMAP AND operation. The resulting bitmap is converted to a count. Based on the counts returned, a sort aggregate operation sums the values and returns the output to the user.

 

Related Topics

Verwandte Dokumente

The document was helpful.

Bewertung auswählen

I easily found the information I needed.

Bewertung auswählen