mirror of
https://github.com/lobehub/lobehub.git
synced 2026-03-26 13:19:34 +07:00
* move db * refactor db import * refactor eval types * fix tests * fix tests * fix tests * fix db migration issues * fix docker issue * fix tests * update alias * fix tests * update db test for client and server * refactor db * update codecov * update codecov * update codecov * add docker pr comments
15 lines
717 B
SQL
15 lines
717 B
SQL
-- Migration to apply specific autovacuum settings to high-traffic tables
|
|
-- This is crucial to prevent table and TOAST bloat for 'embeddings' and 'chunks'
|
|
-- https://github.com/lobehub/lobe-chat/issues/8316
|
|
|
|
-- Tuning for the 'embeddings' table
|
|
-- Default scale factor (0.2) is too high, leading to infrequent vacuuming.
|
|
-- Lowering to 2% to ensure frequent cleanup.
|
|
ALTER TABLE "embeddings" SET (autovacuum_vacuum_scale_factor = 0.02, autovacuum_vacuum_threshold = 1000);
|
|
|
|
--> statement-breakpoint
|
|
|
|
-- Tuning for the 'chunks' table
|
|
-- This table also experiences many updates/deletes and requires similar tuning.
|
|
ALTER TABLE "chunks" SET (autovacuum_vacuum_scale_factor = 0.02, autovacuum_vacuum_threshold = 1000);
|