---
title: 'Indexing on unique columns'
metaTitle: 'Optimize recommendations: Indexing on unique columns'
metaDescription: "Learn about the recommendation provided by Optimize regarding indexing on uniquely constrained columns."
tocDepth: 3
toc: true
---

Optimize identifies redundant indexing on unique columns and provides recommendations for better database performance.

### Why this is an issue

Unique constraints inherently enforce uniqueness by generating an underlying index. Adding an additional index to the same column is unnecessary and can lead to extra overhead. 

This redundancy increases write costs and slows down updates, as the database must synchronize multiple indexes.

:::note

This guideline also applies broadly to relational databases like PostgreSQL, MySQL, MariaDB, SQLite, and SQL Server, which automatically create indexes for unique constraints.

:::