Académique Documents
Professionnel Documents
Culture Documents
To explain in plain English, an Index could be considered as a unique bookmark to a database cell (of those columns which are indexed). For each cell in an indexed column, there will be a unique identifier, which is known as the index. Indexes are stored in the Index segments in Oracle database (unless it is an Index Organized table (IOT) which we are not discussing here). In Oracle 9i, Indexes contain an entry for each cell value that appears in the indexed column(s) of the table or cluster. So, when an index is used in a query, Oracle Engine first searches through the indexes and reaches the index of the particular cell value, it is searching for. Then it goes to the table and fetches only that particular value. Thus we could avoid Full table scans. Thus an index is a performance-tuning method which allows faster retrieval of records. Oracle supports different types of indexes: B-Tree indexes (Normal) Bitmap indexes Partitioned indexes Function-based indexes Domain indexes Here we are going to discuss about B-Tree and Bitmap Indexes.
Fig 1.1 Binary Tree How to Create an Index? CREATE INDEX IDX_NAME ON TABLE_NAME (Col_nam1,Col_nam2, ) COMPUTE STATISTICS ; --optional
II. Oracle - Bitmap Index: Oracle Bitmap Indexes are different from Standard B-Tree Indexes in the way they store the information about the indexes. Bitmap Indexes stores the information about the value in bits; with 0s and 1s; thus called Bitmaps. Something like this:
Bitmap Index creates a two-dimensional array with one column for every row in the table being indexed. If the value being indexed is found in the row, it will specify a 1 and if not found then a 0 . So while searching, Oracle takes only the information from those rows which shows a 1 in the Bitmap Index. That means, the records which are pointed by the 1 s in the Index, have got the searched/indexed value And from a performance point of view, during the data retrieval time,
Oracle decompresses the bitmap into the RAM data buffers so that it can rapidly scan for matching values. These matching values are the given to the Oracle engine in the form of a ROWID list, and ROWIDs as we know are unique identifiers to records/rows.
Q. How to Create a Bitmap Index? CREATE BITMAP INDEX ON COMPUTE STATISTICS ; IDX_NAME TABLE_NAME (Col_nam1,Col_nam2, )
If the application is running very slow? At what points you need to go about the database in order to improve the performance? Answer : For improving performance, we need to check the sql statement blocks , because for every sql satement execution transform to sql engine and come back to plsql engine that process takes more time to process the plsql block. Is there a limit on the size of a PL/SQL block? Answer: Currently, the maximum parsed/compiled size of a PL/SQL block is 64K and the maximum code size is 100K.You can run the following select statement to query the size of an existing package or procedure. SQL> select * from dba_object_size where name = 'procedure_name' Describe Oracle database's physical and logical structure ? Answer:
Physical : Data files, Redo Log files, Control file. Logical : Tables, Views, Tablespaces, etc.