4.0.0: Исправлена обработка старых дампов
All checks were successful
Build and Push Docker Image / build-and-push (push) Successful in 1m19s

This commit is contained in:
poignatov
2026-01-25 16:41:50 +03:00
parent b8ef59bfd1
commit 90643c504a
42 changed files with 2052 additions and 1157 deletions

View File

@@ -0,0 +1,25 @@
-- Migration: Add covering indexes for task detail queries
-- Date: 2026-01-25
--
-- This migration adds covering indexes to optimize queries by including
-- all needed columns in the index, avoiding table lookups.
--
-- Covering indexes allow PostgreSQL to perform index-only scans,
-- getting all data directly from the index without accessing the table.
-- Covering index for subtasks query
-- Includes all columns needed for subtasks selection to avoid table lookups
CREATE INDEX IF NOT EXISTS idx_tasks_parent_deleted_covering
ON tasks(parent_task_id, deleted, id)
INCLUDE (name, completed, last_completed_at, reward_message, progression_base)
WHERE deleted = FALSE;
-- Covering index for wishlist name lookup
-- Includes name and deleted flag for quick lookup without table access
CREATE INDEX IF NOT EXISTS idx_wishlist_items_id_deleted_covering
ON wishlist_items(id, deleted)
INCLUDE (name)
WHERE deleted = FALSE;
COMMENT ON INDEX idx_tasks_parent_deleted_covering IS 'Covering index for subtasks query - includes all selected columns to avoid table lookups. Enables index-only scans for better performance.';
COMMENT ON INDEX idx_wishlist_items_id_deleted_covering IS 'Covering index for wishlist name lookup - includes name to avoid table lookup. Enables index-only scans for better performance.';