+3
-6
internal/db/postgres/comment_repo.go
·········
perf(comments): optimize batch vote query to only select needed columns
Remove unused cid and created_at columns from batch vote query. These fields were
being fetched but never used in the result mapping.
Changes:
- Remove cid and created_at from SELECT clause
- Keep only subject_uri, direction, and uri (all actively used)
- Maintain same query performance characteristics
This reduces memory usage and network overhead for viewer state hydration without
changing behavior. Each comment query fetches vote state for potentially hundreds
of comments, so column reduction has meaningful impact at scale.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
·········