---
title: "Indexes in DB2 These 3 are Must Know Rules"
description: "Index is popular object in DB2 SQL. Popular questions to your instant knowledge given for quick reference."
url: https://srinimf.com/2018/02/20/db2-index-questions/
date: 2018-02-20
modified: 2022-07-29
author: "Srini"
image: https://i0.wp.com/srinimf.com/wp-content/uploads/2018/02/pexels-photo-7129700.jpeg?fit=1880%2C1253&ssl=1
categories: ["Categories", "DB2"]
tags: ["DB2 Index", "Db2 Tips", "SQL tips and tricks"]
type: post
lang: en
---

# Indexes in DB2 These 3 are Must Know Rules

The index improves the performance of the search. The index looks like a keyword at the end of a book. Here are three must-know points.

## 1.Uniqueness

You can create indexes on a table. The UNIQUE keyword in creating an index enforces uniqueness when you enter data. That means it will not allow [duplicate entries on that column](https://srinimf.com/2018/01/14/db2-logical-storage-theory-to-define-when-creating-table/). It is the main benefit of UNIQUE.

## 2. Index on an Empty Table

**The second point.**

**What will happen if you create an index on an empty table?** There will be no entry in the index table.

## 3. Index on Non-empty Table

**What will happen when you create an index on a table which is non-empty?** Then, the Index-table will have entries.

**The index disadvantage**

If a large number of indexes you create for a table is modified frequently, overall performance will decrease.  

***References and resources***

- [Here’s You Can Practice DB2 Online ](https://www.ibm.com/developerworks/downloads/im/db2express/)
- [Three minute SQL Quiz](https://srinimf.com/2017/11/06/three-minute-sql-quiz-prove-your-knowledge/)

### 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%2F2018%2F02%2F20%2Fdb2-index-questions%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2018%2F02%2Fpexels-photo-7129700.jpeg%3Ffit%3D1200%252C800%26ssl%3D1&description=Indexes%20in%20DB2%20These%203%20are%20Must%20Know%20Rules)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2018/02/20/db2-index-questions/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2018/02/20/db2-index-questions/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2018/02/20/db2-index-questions/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2018/02/20/db2-index-questions/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20Indexes%20in%20DB2%20These%203%20are%20Must%20Know%20Rules&body=https%3A%2F%2Fsrinimf.com%2F2018%2F02%2F20%2Fdb2-index-questions%2F&share=email)
-

### Like this:

Like Loading…
