Index Creation Flowchart: A Flowchart To Help You Know When and What Type of Index To Create in Oracle
Index Creation Flowchart: A Flowchart To Help You Know When and What Type of Index To Create in Oracle
Index Creation
Flowchart
Ben Brumm
www.databasestar.com
Welcome!
In Oracle, creating indexes can often, but not always, speed up a SELECT query. Indexes also slow
down queries that update data, so we don’t want to create indexes on everything!
How do we know which column or columns are good to create indexes on?
We can analyse a few things about our queries and tables to see if it will be helpful to create a index.
To use the flowchart, look at your table, columns, or query. Choose a column, and go through this
flowchart with that column in mind.
Once you reach the end of the flowchart, consider creating the index suggested.
The suggested index is not guaranteed to improve your query, as there are a lot of factors involved,
but it’s a good place to start when working out what index to create.
The flowchart mentions a term called selectivity. Selectivity on a table is the ratio of the number of
distinct values compared to the total number of rows in a table. The higher the selectivity, the more
unique values it has, and the better it would perform using a B-tree index. Lower selectivity columns
often work well with bitmap indexes.
www.DatabaseStar.com
www.DatabaseStar.com