---
title: "DB2: Unique-index Vs Clustered-index"
description: "Indexes improve the performance of the database tables. However, this post covers differences between clustered index and unique index."
url: https://srinimf.com/2020/09/13/db2-unique-index-vs-clustered-index/
date: 2020-09-13
modified: 2026-10-10
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2020/09/pexels-photo-4494642.jpeg?fit=1880%2C1253&ssl=1
categories: ["DB2"]
tags: ["DB2 Unique Vs Clustered index"]
type: post
lang: en
---

# DB2: Unique-index Vs Clustered-index

The index on a table improves performance. In other words, an indexed Table takes less CPU time. And that fetches results faster. Here I am sharing differences between clustered index and Unique-index.

Related[Teradata Unique Secondary Index USI](https://srinimf.com/2014/11/28/teradata-unique-secondary-indexusi/)

## Unique Index

Let me explain it with an example, the column that you use for the UNIQUE index may not be NOT NULL.

Related[SQL Index Vs Database Index: Top Differences](https://srinimf.com/2016/10/08/the-best-differences-sql-index-and-database-index/)

The uniqueness you always expect from the UNIQUE index. So it does not allow duplicates.

Moreover, you can create **multiple** UNIQUE indexes on a Table.

Related[DB2: List of 7 Top Indexes](https://srinimf.com/2010/07/24/db2-indexes/)

**Example**

Related[Logging in IMS DB: A Complete Guide to Audit Trail Records](https://srinimf.com/2016/09/30/3-strong-reasons-why-logging-in-ims-db-needed/)

```
CREATE UNIQUE INDEX ORD_INDX
ON ODER_TABLE (ORDER_NUMBER);
```

## Clustered Index

Only **one index** in a table can be a clustered index. It tries to store records on a page that has similar index keys/values. And it is designed to increase performance by decreasing I/O.

In terms of quantity, you can create only one Clustered index on a Table.

**Example**

```
CREATE UNIQUE INDEX ORD_INDX
ON ODER_TABLE (ORDER_NUMBER)
CLUSTER;
```

Related Posts

- [DB2 Index Vs. Hash Scan: Top Differences](https://srinimf.com/2018/11/01/db2-top-differences-read-on-index-vs-hashing/)DateNovember 1, 2018
- [DB2 SQL: How to Create Index (1 of 2)](https://srinimf.com/2015/08/09/db2-different-sql-queries-for-creating-index-1-of-2/)DateAugust 9, 2015
- [DB2: List of 7 Top Indexes](https://srinimf.com/2010/07/24/db2-indexes/)DateJuly 24, 2010

### Share this:

-
- [Tweet](https://twitter.com/share)
- [![](https://i0.wp.com/assets.pinterest.com/images/pidgets/pinit_fg_en_rect_gray_20.png)](https://www.pinterest.com/pin/create/link/?url=https%3A%2F%2Fsrinimf.com%2F2020%2F09%2F13%2Fdb2-unique-index-vs-clustered-index%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2020%2F09%2Fpexels-photo-4494642.jpeg%3Ffit%3D1200%252C800%26ssl%3D1&description=DB2%3A%20Unique-index%20Vs%20Clustered-index)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2020/09/13/db2-unique-index-vs-clustered-index/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2020/09/13/db2-unique-index-vs-clustered-index/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2020/09/13/db2-unique-index-vs-clustered-index/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2020/09/13/db2-unique-index-vs-clustered-index/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20DB2%3A%20Unique-index%20Vs%20Clustered-index&body=https%3A%2F%2Fsrinimf.com%2F2020%2F09%2F13%2Fdb2-unique-index-vs-clustered-index%2F&share=email)
-

### Like this:

Like Loading…
