Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Add database indexes for user-scoped queries

オープン
#46 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
68/100
issue の種類
機能追加
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
csharp, sql

調査の方向性

LearnStack.Core/Data/ApplicationDbContext.cs で OnModelCreating を確認することから始め、その後、既存の migration 設定を調べます。提案されたインデックスを適用し、約 10,000 件のリソースをシードして、リソース一覧、Pulse、content-ideas のクエリの実行プランを比較します。これらのクエリでインデックスが使用され、テーブルスキャンが発生しなければ完了です。

索引モデルが issue の本文から書いたものです。

説明

enhancement

Tier 2 — scale

Problem

Every query in the app filters by UserId, and there is no index on UserId for LearningResources, ContentIdeas or SharedResourceGroups. The only indexes configured are the unique ones on ShareToken and invitation Token. Every page load is a table scan — and because thumbnails live on the same row (see #45), each scan drags the blobs with it.

Evidence
  • LearnStack.Core/Data/ApplicationDbContext.cs — OnModelCreating defines indexes only on SharedResourceGroup.ShareToken, FriendInvitation.Token and the friendship pair
Proposed fix

Add in a migration:

  • LearningResources (UserId, IsArchived, Status)
  • LearningResources (UserId, IsPublic) filtered on IsPublic = 1
  • ContentIdeas (UserId, Status)
  • SharedResourceGroups (UserId)

Then confirm with actual execution plans on a seeded dataset.

Acceptance criteria
  • No table scans on the resource list, Pulse or content-ideas pages
  • Index usage verified against a dataset of ~10k resources
主要言語
HTML
スター
10
フォーク
0
平均マージ
2時間 35分
マージ済み PR(30日)
21

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

kasuken/LearnStack のほかの issue

kasuken/LearnStack の issue をすべて見る

似ている issue

Backend & API Design の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。