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-14 14:46:36 +00:00
parent 4fc4154dcc
commit f424d02523
149 changed files with 9811 additions and 262 deletions
+6
View File
@@ -62,6 +62,8 @@ def _seed_post_with_comments(comment_texts, topic="devlog"):
marker = f"seedpost-{post_uid[:8]}"
get_table("posts").insert(
{
"deleted_at": None,
"deleted_by": None,
"uid": post_uid,
"user_uid": owner,
"slug": make_combined_slug(marker, post_uid),
@@ -79,6 +81,8 @@ def _seed_post_with_comments(comment_texts, topic="devlog"):
for i, text in enumerate(comment_texts):
comments.insert(
{
"deleted_at": None,
"deleted_by": None,
"uid": str(uuid4()),
"target_type": "post",
"target_uid": post_uid,
@@ -266,6 +270,8 @@ def _seed_projects(count):
title = f"Pag Project {i}"
projects.insert(
{
"deleted_at": None,
"deleted_by": None,
"uid": uid,
"user_uid": owner,
"slug": make_combined_slug(title, uid),