feat: add composite index on messages(channel_id, created_at)#132
Merged
mahata merged 2 commits intofeat/channelsfrom Mar 26, 2026
Merged
feat: add composite index on messages(channel_id, created_at)#132mahata merged 2 commits intofeat/channelsfrom
mahata merged 2 commits intofeat/channelsfrom
Conversation
Agent-Logs-Url: https://github.com/mahata/mlack/sessions/d188e657-de69-47e9-9277-0c7227faaffd Co-authored-by: mahata <23497+mahata@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] [WIP] Address feedback on Slack-like channels and sidebar UI implementation
feat: add composite index on messages(channel_id, created_at)
Mar 26, 2026
mahata
added a commit
that referenced
this pull request
Mar 26, 2026
…aging (#130) * feat: add Slack-like channels with sidebar UI and channel-scoped messaging Add a Channel feature where each message belongs to a single channel and channels can have multiple members. All users are auto-joined to #general. - Add channels and channel_members tables with migration (seeds #general, backfills existing messages) - Add channel CRUD API routes (list, create, join, leave) with 14 tests - Update messages API to require channelId query parameter - Switch WebSocket protocol from plain text to JSON with channel-scoped broadcast (only channel members receive messages) - Add dark-themed Slack-like UI with channel sidebar, create channel modal, join/leave functionality - Auto-join users to #general on page visit - Update all existing tests for new HTML structure and API changes * Update hono/routes/messages.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * Update hono/static/ChatPage.ts Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> * feat: add composite index on messages(channel_id, created_at) (#132) * Initial plan * feat: add composite index on (channel_id, created_at) to messages table Agent-Logs-Url: https://github.com/mahata/mlack/sessions/d188e657-de69-47e9-9277-0c7227faaffd Co-authored-by: mahata <23497+mahata@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: mahata <23497+mahata@users.noreply.github.com> * [WIP] Fix the failing GitHub Actions workflow e2e (#134) * Initial plan * fix: add h1 Hello, world! heading to ChatPage for e2e test Agent-Logs-Url: https://github.com/mahata/mlack/sessions/00133b70-6800-4b81-9ad8-fb4b19a6e07c Co-authored-by: mahata <23497+mahata@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: mahata <23497+mahata@users.noreply.github.com> --------- Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com> Co-authored-by: mahata <23497+mahata@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Without an index, queries filtering messages by channel with ordering (
WHERE channel_id = ? ORDER BY created_at DESC LIMIT 100) result in sequential scans as the table grows.Changes
hono/db/schema.ts: Added a btree composite indexmessages_channel_id_created_at_idxon(channel_id, created_at)to themessagestablehono/db/migrations/0003_spotty_christian_walker.sql: Generated migration applying the index📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.