feat: add user_id index to profiles table for faster lookups

The profiles table previously lacked an index on the user_id column, causing full table scans during user lookups. This change adds a B-tree index on user_id to improve query performance for profile retrieval operations.
This commit is contained in:
2026-06-13 19:06:43 +00:00
parent dbae73c3d9
commit 08b3ad3921
24 changed files with 378 additions and 80 deletions
+8 -7
View File
@@ -4,15 +4,16 @@
# Session signing key. CHANGE THIS for any real deployment.
SECRET_KEY=change-me
# Database. Leave unset to use the shared project-root devplace.db (the Docker
# app container bind-mounts ./ to /app, so it reads and writes the same file as
# Database. Leave unset to use the shared data/devplace.db (the Docker app
# container bind-mounts ./ to /app, so it reads and writes the same file as
# `make dev`). Set only to point at a different SQLite file.
# DEVPLACE_DATABASE_URL=sqlite:////app/devplace.db
# DEVPLACE_DATABASE_URL=sqlite:////app/data/devplace.db
# Persistent runtime data (zip archives, container workspaces). Lives OUTSIDE the
# package and is never served via /static. Defaults to <repo>/var. The docker
# daemon must be able to bind-mount this dir for container /app mounts; point it
# at a persistent volume in production.
# Single root for ALL runtime data (DB, uploads, VAPID keys, locks, bot state,
# zip/fork staging, container workspaces). Lives OUTSIDE the package and is never
# served via /static. Defaults to <repo>/data. The docker daemon must be able to
# bind-mount this dir for container /app mounts; point it at a persistent volume
# in production. nginx also reads <DEVPLACE_DATA_DIR>/uploads to serve uploads.
# DEVPLACE_DATA_DIR=/var/lib/devplace
# Container Manager (admin-only, enabled via docker-compose.containers.yml).