[PR #7449] [MERGED] fix(server): truncate embedding tables #11625

Closed
opened 2026-02-05 14:42:59 +03:00 by OVERLORD · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/immich-app/immich/pull/7449
Author: @mertalev
Created: 2/27/2024
Status: Merged
Merged: 2/27/2024
Merged by: @alextran1502

Base: mainHead: fix/server-truncate


📝 Commits (1)

📊 Changes

6 files changed (+16 additions, -16 deletions)

View changed files

📝 server/src/domain/repositories/search.repository.ts (+1 -0)
📝 server/src/domain/smart-info/smart-info.service.spec.ts (+2 -0)
📝 server/src/domain/smart-info/smart-info.service.ts (+4 -0)
📝 server/src/infra/repositories/person.repository.ts (+2 -2)
📝 server/src/infra/repositories/search.repository.ts (+6 -14)
📝 server/test/repositories/search.repository.mock.ts (+1 -0)

📄 Description

Description

Re-running smart search or face detection destroys the HNSW index because of the number of dead tuples it creates. Truncating is appropriate here since it also purges dead tuples and indexes. We avoided truncation before because it didn't work on pgvecto.rs 0.1.11, but we can safely do it on 0.2.0 now.

Fixes #7313

How Has This Been Tested?

Tested with running "all" jobs on smart search and face detection, as well as by changing the smart search model.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/immich-app/immich/pull/7449 **Author:** [@mertalev](https://github.com/mertalev) **Created:** 2/27/2024 **Status:** ✅ Merged **Merged:** 2/27/2024 **Merged by:** [@alextran1502](https://github.com/alextran1502) **Base:** `main` ← **Head:** `fix/server-truncate` --- ### 📝 Commits (1) - [`1a3766b`](https://github.com/immich-app/immich/commit/1a3766b10bf9a35b05b18c8f493b74fe97c4db18) truncate ### 📊 Changes **6 files changed** (+16 additions, -16 deletions) <details> <summary>View changed files</summary> 📝 `server/src/domain/repositories/search.repository.ts` (+1 -0) 📝 `server/src/domain/smart-info/smart-info.service.spec.ts` (+2 -0) 📝 `server/src/domain/smart-info/smart-info.service.ts` (+4 -0) 📝 `server/src/infra/repositories/person.repository.ts` (+2 -2) 📝 `server/src/infra/repositories/search.repository.ts` (+6 -14) 📝 `server/test/repositories/search.repository.mock.ts` (+1 -0) </details> ### 📄 Description ## Description Re-running smart search or face detection destroys the HNSW index because of the number of dead tuples it creates. Truncating is appropriate here since it also purges dead tuples and indexes. We avoided truncation before because it didn't work on pgvecto.rs 0.1.11, but we can safely do it on 0.2.0 now. Fixes #7313 ## How Has This Been Tested? Tested with running "all" jobs on smart search and face detection, as well as by changing the smart search model. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
OVERLORD added the pull-request label 2026-02-05 14:42:59 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: immich-app/immich#11625