Skip to content

Confirm InnoDB secondary index structure for comments table#347

Draft
Copilot wants to merge 1 commit intorefactor/#343-comment-show-apifrom
copilot/sub-pr-346
Draft

Confirm InnoDB secondary index structure for comments table#347
Copilot wants to merge 1 commit intorefactor/#343-comment-show-apifrom
copilot/sub-pr-346

Conversation

Copy link

Copilot AI commented Feb 18, 2026

Review comment questioned whether comment_id (PK) should be explicitly included in the composite index (post_id, parent_id) for the comments table, given queries that filter and sort by these columns.

Analysis

InnoDB secondary indexes automatically include the primary key in leaf nodes. The index defined as:

CREATE INDEX idx_comments_post_parent ON comments (post_id, parent_id);

Internally functions as (post_id, parent_id, comment_id). Queries like:

WHERE post_id=? AND parent_id IS NULL ORDER BY comment_id DESC

Already use the index efficiently for both filtering and sorting without explicit PK inclusion.

Outcome

  • Current implementation is optimal
  • No changes required to migration or entity annotations
  • Explicit comment_id inclusion would be redundant (no performance impact either way)

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copy link
Author

Copilot AI commented Feb 18, 2026

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/graphql
    • Triggering command: /usr/bin/gh gh pr view 346 --json title,body (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Fix index structure in comment retrieval API Confirm InnoDB secondary index structure for comments table Feb 18, 2026
Copilot AI requested a review from seongjunnoh February 18, 2026 12:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

Comments