---
title: "DB2 v11 SQL: Remove Duplicates Enhancement"
description: "Enhanced duplicate removal: – Lots of queries require duplicate removal: e.g. DISTINCT, GROUP BY, etc. – Dup elimination via sorting can be expensive. – New techniques: Index duplicate removal, early..."
url: https://srinimf.com/2014/09/17/db2-v11-new-technique-duplicate-removal/
date: 2014-09-17
modified: 2026-10-10
author: "Srini"
categories: ["DB2"]
tags: ["Duplicate Removal in DB2V11"]
type: post
lang: en
---

# DB2 v11 SQL: Remove Duplicates Enhancement

**Enhanced duplicate removal:**

– Lots of queries require duplicate removal: e.g. DISTINCT, GROUP BY, etc.

– Dup elimination via sorting can be expensive

– New techniques: **Index duplicate removal, early out**

Related[DB2 V11 Top New Features](https://srinimf.com/2014/01/31/db2-v11-zos-new-features/)

**Index duplicate removal:**

One feature that the IDUG team has been investigating is improvements to Unique/DISTINCT and GROUP BY processing. This is an enhancement that will be realized the next time a statement is compiled (prepare or bind) after migrating to DB2 11, and the improvements can be significant, but it’s not something that is easily detectable by the average developer or DBA.

Related[Distinct Vs Group By: Optimal Method for Sorting Table Rows](https://srinimf.com/2023/10/26/how-to-sort-rows-in-sql-shortcuts-the-easy-way/)

Certain SQL statements will be impacted, such as:

- SELECT DISTINCT
- GROUP BY
- Single MAX or MIN aggregate function
- GROUP BY with a single MAX or MIN function
- Certain non-correlated subqueries (not transformed)

1. **[Additional Info DB2](http://www.idug.org/p/bl/et/blogid=278&blogaid=151)**
2. **[Read more here](http://www.tridug.org/wp-content/uploads/2013/12/DB2-11-Overview-TRIDUG.pdf)**

### 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%2F2014%2F09%2F17%2Fdb2-v11-new-technique-duplicate-removal%2F&media=https%3A%2F%2Fi0.wp.com%2Fsrinimf.com%2Fwp-content%2Fuploads%2F2026%2F02%2Fcropped-logo.png%3Ffit%3D96%252C96%26ssl%3D1&description=DB2%20v11%20SQL%3A%20Remove%20Duplicates%20Enhancement)
-
- [Share on Tumblr](https://www.tumblr.com/share)
- [Share on WhatsApp (Opens in new window) WhatsApp](https://srinimf.com/2014/09/17/db2-v11-new-technique-duplicate-removal/?share=jetpack-whatsapp)
- [More](#)
-

- [Print (Opens in new window) Print](https://srinimf.com/2014/09/17/db2-v11-new-technique-duplicate-removal/?share=print)
- [Share on Reddit (Opens in new window) Reddit](https://srinimf.com/2014/09/17/db2-v11-new-technique-duplicate-removal/?share=reddit)
- [Share on Telegram (Opens in new window) Telegram](https://srinimf.com/2014/09/17/db2-v11-new-technique-duplicate-removal/?share=telegram)
- [Email a link to a friend (Opens in new window) Email](mailto:?subject=%5BShared%20Post%5D%20DB2%20v11%20SQL%3A%20Remove%20Duplicates%20Enhancement&body=https%3A%2F%2Fsrinimf.com%2F2014%2F09%2F17%2Fdb2-v11-new-technique-duplicate-removal%2F&share=email)
-

### Like this:

Like Loading…
