Is secondary index worthy?

Deepak Atariya
2 min readFeb 17, 2023

--

What is secondary indexing?

It is a technique to make search faster in a database management system. Also, it is a two-index technique used to reduce the mapping size of the primary index. In other words, it is another index in the table that can be used to make queries with non-primary key fields/columns in DBMS.

Why secondary indexing?

To create an additional index other than the primary key. So that we can make queries with other columns. As it is dense by default it consumes more memory than the primary index.

How does it work?
The secondary index can be implemented with key and non-key columns. As it always maintains a dense index then does not require columns to be sorted or unsorted.

If we are applying a secondary index in key-type columns, which means a unique value column then it maintains one dense index internally.

secondary index key column

--

--

Deepak Atariya
Deepak Atariya

Written by Deepak Atariya

I am a software engineer at Emirates NBD, Dubai. Seeking to help other by sharing my what I am learning ✌🏻

No responses yet