---
title: "How to do database column indexing?"  
description: "How to do database column indexing?"  
author: "Ailsa Singh"  
published: 2016-04-08  
updated: 2016-09-26  
canonical: https://www.mindstick.com/forum/34098/how-to-do-database-column-indexing  
category: "database"  
tags: ["database", "sql server", "index"]  
reading_time: 1 minute  

---

# How to do database column indexing?

Can any one tell me how can I [index](https://www.mindstick.com/blog/198/index-in-sql-server) columns, when [our data](https://yourviews.mindstick.com/view/70567/data-protection-bill-understanding-our-data)-Set increases in size.\
Because whenever I [click](https://www.mindstick.com/articles/12423/social-login-magento-2-one-click-to-register-social) on different [links](https://www.mindstick.com/blog/415/css3-links) I didn't get the correct pages.\
\
So, [please tell me](https://www.mindstick.com/forum/33900/please-tell-me-what-are-the-technique-to-content-optimization) how [column](https://www.mindstick.com/forum/33860/how-to-calculate-column-summary-in-sql-server) [indexing](https://www.mindstick.com/blog/303693/how-search-engines-work-crawling-indexing-and-ranking) works at a [database](https://www.mindstick.com/articles/12226/use-of-database-in-sencha-extjs-and-insert-record-from-user-form-using-ajax) agnostic level.

## Replies

### Reply by Revathi Parvathi

Good.

### Reply by Tarun Kumar

To create Indexing we need a table - so we assume that you already created a table. After that create an Index on the table that don't allowed duplicate values the table you already have.\
Here we will create two indexs first will allow duplicate values and the second one will not allow duplicate values, like this:\
\
This Index allowd duplicate values, use like this:\
**CREATE INDEX indexName1 ON tableName(columnName)**\
This Index don't allow duplicate values, use like this:\
**CREATE UNIQUE INDEX indexName2 ON tableName (columnName)**\
After that create a Clustered Index, like this:\
**CREATE CLUSTERED INDEX clusterIndexName on SALES(ID);**\
and at last to create Non-clustered index, use like this:\
**CREATE NONCLUSTERED INDEX nonClusterIndexName ON SALES(ProductCode);**\
I hope the above solution will be helpful for you.


---

Original Source: https://www.mindstick.com/forum/34098/how-to-do-database-column-indexing

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
