Home » SQL & PL/SQL » SQL & PL/SQL » index (oracle 11g)
index [message #628416] Tue, 25 November 2014 01:05 Go to next message
Ashish_chand
Messages: 2
Registered: November 2014
Location: Bangalore
Junior Member
hello All,

I ran he following query

explain plan set statement_id='ee'
for
select * from harsh_emp where empno =7300 and job='MANAGER' and ename='CHAND'

empno is primary key
EMP_ID is unique key on (ename , job)

plan table shows something that I have attached as JPG file, please have a look.


My concern is why BITMAP conversion is happening , please explain.

Re: index [message #628417 is a reply to message #628416] Tue, 25 November 2014 01:09 Go to previous messageGo to next message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Because Oracle uses several indexes, it builds a bitmap representation of all rows selected by each index and make an AND between these bitmaps to retrieve the rows that satisfy both conditions.

Re: index [message #628419 is a reply to message #628417] Tue, 25 November 2014 02:35 Go to previous messageGo to next message
Ashish_chand
Messages: 2
Registered: November 2014
Location: Bangalore
Junior Member
thanks Michel..

so you mean this mapping occurs when we use two index on a table???
because I cant see BITMAP conversion in case if all index are UNIQUE or a single unique index. But I can see this happening when there are unique index and an index on primary key.
Re: index [message #628428 is a reply to message #628419] Tue, 25 November 2014 04:03 Go to previous message
Michel Cadot
Messages: 68624
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

It happens when Oracle (estimates it) can use several indexes for the table to execute the statement.

Previous Topic: json data
Next Topic: Varchar2(4000 bytes) to Varchar2(4000 char) Conversion
Goto Forum:
  


Current Time: Thu Mar 28 07:27:00 CDT 2024