Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Add database indexes for user-scoped queries

Open
#46 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
68/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Active
Tech stack
csharp, sql

Research direction

Start in LearnStack.Core/Data/ApplicationDbContext.cs by reviewing OnModelCreating and then inspect the existing migration setup. Apply the proposed indexes, seed roughly 10k resources, and compare execution plans for the resource list, Pulse, and content-ideas queries. Done means those queries show index usage with no table scans.

Written by the indexing model from the issue text.

Description

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
Dominant language
HTML
Stars
10
Forks
0
Avg merge
3h 42m
Merged PRs (30d)
14

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from kasuken/LearnStack

All issues in kasuken/LearnStack

Similar issues

More Backend & API Design issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.