Professional Documents
Culture Documents
SQL WORLD
GET YOUR SQL QUERY FAST AND FURIOUS..
Index BI Tutorials
SQL Joins
SQL Tutorials
Unix Tutorials
RECENT POSTS
http://www.complexsql.com/indexing-in-sql/ 1/15
8/11/2017 SQL Indexes | Performance Tuning | Normal Index | Unique Index | Bitmap Index | Global Index | Local Index
the query.Indexing sometimes improve the performance but make Intelligence Architecture
sure that the table is not inserting or updating the data while you are
Features of OBIEE | Advantages
running the query.
Of OBIEE | How to Log in in
OBIEE?
CLICK HERE TO GET BASIC IDEA OF PERFORMANCE TUNING
Database Schema used in OBIEE
De nition Of Index: | Star Schema | Snow ake
schema
http://www.complexsql.com/indexing-in-sql/ 2/15
8/11/2017 SQL Indexes | Performance Tuning | Normal Index | Unique Index | Bitmap Index | Global Index | Local Index
In this article i will give brief introduction about Normal index,Bit map Unix Filter commands | Touch
index and unique index which are most widely used indexes to tune command with example | ps
To create normal index you must have CREATE ANY INDEX Filter Commands in Unix | Cut
privilege.After that you can create index on the table.Before creating command with Example | Paste
these indexes you need to go to table and check the cost of the Command With Example |
table.If you are using SQL developer editor you will get query cost by Translate (tr) Command with
pressing F10 key else you are using the direct statement Explain Example
Plan before SQL Query.After checking the cost of query user needs to
File Commands with Examples |
check whether any indexes are there on the table or
WC command with Example | CP
not.ALL_INDEXES is the system table which gives user the
Command with Example | CMP
information about the indexes on the table.If Indexing is not there on
Command with Example | LS
table level you can do the indexing on column of the table.
command with Example | RM
command with Example
Syntax of Normal Index:
Unix Directory Commands |
Create index Index_name on Table_Name(Column_Name); Create Directory in Unix | Mkdir
Command with Example | PWD
Example: command with example | Rmdir
command to remove directory |
Create index NI_EMP_NAME on EMP(NAME); Cd command to change directory
Unique key constaint columns you separately need to do Frequently Used Unix
indexing.Kindly make sure that Unique key indexes created on the Commands | Unix Commands
columns which has unique values only. with Examples | Useful Unix
Commands
http://www.complexsql.com/indexing-in-sql/ 3/15
8/11/2017 SQL Indexes | Performance Tuning | Normal Index | Unique Index | Bitmap Index | Global Index | Local Index
Explain Planselect * from DEPT d,EMP e where d.DEPTNO= e.deptno; SUBSCRIBE TO BLOG VIA
EMAIL
Output:
Enter your email address to
Cost of DEPT Table-20000 table is Full Scanned subscribe to this blog and receive
noti cations of new posts by
Cost of EMP tabe-20000-table is Full Scanned
email.
Join 55 other subscribers
Step 2:
Email Address
Output:
No indexes found.
Step 3:
Check description of the table and check whether the normal index
where the Unique index and where bitmap indexes are applicable.
Step 4:
Step 5:
Step 6:
http://www.complexsql.com/indexing-in-sql/ 5/15
8/11/2017 SQL Indexes | Performance Tuning | Normal Index | Unique Index | Bitmap Index | Global Index | Local Index
Step 7:
Output:
Composite Index:
When 2 or more columns in single table are related which each other
and used in where condition of select statement then user should
create composite index on the columns which are created.If all
columns selected by in query are in composite index then oracle will
return the values from the index without accessing the table.
Example:
Select e.Emp_name,d.Dept_name
where e.Empno=d.empno
and e.Deptno=d.Deptno;
http://www.complexsql.com/indexing-in-sql/ 6/15
8/11/2017 SQL Indexes | Performance Tuning | Normal Index | Unique Index | Bitmap Index | Global Index | Local Index
Syntax:
Example:
Clustered Indexes:
4.If table is under heavy data modi cations the clustered indexes are
preferable to use.
http://www.complexsql.com/indexing-in-sql/ 7/15
8/11/2017 SQL Indexes | Performance Tuning | Normal Index | Unique Index | Bitmap Index | Global Index | Local Index
Global Index:
Usually when you create index on the table has indexed but when
you are using partitioned table we need to change the syntax of the
create index and need to use the Global index for one to many
relationship.Global index is one to many relationships which allows
index partition to map to many table partitions.The global index can
be partitioned by range or hash method and it can be de nd on any
kind of partitioned or non partitioned table.
Syntax:
On tablename(Column name)
GLOBAL
Example:
Create indexEmployee_GI
http://www.complexsql.com/indexing-in-sql/ 8/15
8/11/2017 SQL Indexes | Performance Tuning | Normal Index | Unique Index | Bitmap Index | Global Index | Local Index
On tablename(Employee_num)
GLOBAL
LOCAL INDEX:
Syntax:
on table_name(Column_name)
LOCAL
(Partition Partition_name1,
Partition Partition_name2.
);
Hope you will get brief idea about indexing.If you like this article dont
forget to comment in comment section.
HOME
Like 139
Share this:
http://www.complexsql.com/indexing-in-sql/ 9/15
8/11/2017 SQL Indexes | Performance Tuning | Normal Index | Unique Index | Bitmap Index | Global Index | Local Index
139
Related
PREVIOUS NEXT
SQL Set Operators| SQL Statements |
Intersect and Minus SQL Select
in SQL | Real Life Statement | Step-
Scenarios | by-step Execution of
Di erence Between Select Statement |
Intersect and Minus Data Query
| Real Life Examples Language
of Intersect and
Minus
14 COMMENTS
priyanka
FEBRUARY 9, 2017 AT 2:02 PM
REPLY
admin
FEBRUARY 9, 2017 AT 3:46 PM
http://www.complexsql.com/indexing-in-sql/ 10/15
8/11/2017 SQL Indexes | Performance Tuning | Normal Index | Unique Index | Bitmap Index | Global Index | Local Index
REPLY
priyanka
FEBRUARY 9, 2017 AT 2:20 PM
The Explain Plan [Query] which you have described here I am not
able to Query in SQL Server 2008 R2 Server.
REPLY
admin
FEBRUARY 9, 2017 AT 3:49 PM
If you are working on SQL server you will not get your query plan
using Explain command.You need to use CTL + M command to
get your query plan.You can use SQL server pro ler to analyse
the query also..
Thanks for posting..If other information needed i will help u
REPLY
priyanka
FEBRUARY 17, 2017 AT 10:23 AM
REPLY
http://www.complexsql.com/indexing-in-sql/ 11/15
8/11/2017 SQL Indexes | Performance Tuning | Normal Index | Unique Index | Bitmap Index | Global Index | Local Index
admin
FEBRUARY 17, 2017 AT 4:37 PM
REPLY
Prashanta Hegde
FEBRUARY 21, 2017 AT 10:30 AM
Hi Sir,
Thank you so much I have read 2-3 articles. Very well explained.
Thanks,
Prashanth
REPLY
admin
FEBRUARY 21, 2017 AT 4:51 PM
REPLY
Hanuman
FEBRUARY 28, 2017 AT 7:20 AM
REPLY
admin
FEBRUARY 28, 2017 AT 2:58 PM
REPLY
http://www.complexsql.com/indexing-in-sql/ 12/15
8/11/2017 SQL Indexes | Performance Tuning | Normal Index | Unique Index | Bitmap Index | Global Index | Local Index
REPLY
Saket Parab
APRIL 7, 2017 AT 4:27 AM
In the non clustered index part, you have stated: We can create 0 to
249 clustered indexes on single table, it should be Non-Clustered
and not clustered Index, as only one clustered index is allowed per
table.
REPLY
admin
APRIL 9, 2017 AT 4:17 AM
REPLY
Chin
APRIL 22, 2017 AT 12:32 PM
REPLY
admin
APRIL 24, 2017 AT 3:27 PM
Thanks Chin
REPLY
11 TRACKBACKS / PINGBACKS
http://www.complexsql.com/indexing-in-sql/ 13/15
8/11/2017 SQL Indexes | Performance Tuning | Normal Index | Unique Index | Bitmap Index | Global Index | Local Index
OBIEE
Leave a Reply
Your email address will not be published.
http://www.complexsql.com/indexing-in-sql/ 14/15
8/11/2017 SQL Indexes | Performance Tuning | Normal Index | Unique Index | Bitmap Index | Global Index | Local Index
Comment
Name *
Email *
Website
POST COMMENT
http://www.complexsql.com/indexing-in-sql/ 15/15