Skip to content

Commit

Permalink
feat: add unnecessary index recommendation (#6551)
Browse files Browse the repository at this point in the history
Co-authored-by: Jon Harrell <[email protected]>
  • Loading branch information
ankur-arch and jharrell authored Jan 9, 2025
1 parent ce8a553 commit 700ae51
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions content/700-optimize/300-recordings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ When a recording session ends, Optimize generates recommendations such as:
- [Using `@db.Char(n)`](/optimize/recommendations/avoid-char)
- [Using `@db.VarChar(n)`](/optimize/recommendations/avoid-varchar)
- [Using `timestamp(0)` or `timestamptz(0)`](/optimize/recommendations/avoid-timestamp-timestampz-0)
- [Unnecessary indexes](/optimize/recommendations/unnecessary-indexes)

:::info
Use [Prisma AI](/optimize/prisma-ai) to ask follow-up questions about a recommendation.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: 'Unnecessary indexes'
metaTitle: 'Optimize Recommendations: Unnecessary indexes'
metaDescription: "Learn about the recommendation provided by Optimize for using Unnecessary indexes"
tocDepth: 3
toc: true
---

Optimize detects unnecessary indexes and recommends removing them to improve database performance.

### Why this is a problem

Indexes enhance database query performance but can harm efficiency when overused. They consume storage and add overhead to `INSERT`, `UPDATE`, and `DELETE` operations. Unnecessary indexes can result in:

- **Increased write costs:** Extra indexes slow down write operations.
- **Higher storage use:** Unused indexes waste storage space.
- **Query optimizer confusion:** Redundant indexes may cause inefficient query plans.

Removing unnecessary indexes improves performance and simplifies maintenance.

0 comments on commit 700ae51

Please sign in to comment.