Skip to content

fix(): repetitions timestamp index on collection creation#649

Open
e11sy wants to merge 4 commits intomasterfrom
fix/repetitions-timestamp-index
Open

fix(): repetitions timestamp index on collection creation#649
e11sy wants to merge 4 commits intomasterfrom
fix/repetitions-timestamp-index

Conversation

@e11sy
Copy link
Copy Markdown
Member

@e11sy e11sy commented May 5, 2026

Limiter query that counts documents with timestamp $gt billing period start was a collscan because we did not have indexes on creation of the new repetitions:<projectId> collections

this kind of queries (and not only in limiter) led to memory pressure and high cpu usage

@neSpecc neSpecc requested a review from Copilot May 5, 2026 13:56
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a missing MongoDB index for newly created repetitions:<projectId> collections so queries filtering by timestamp (e.g., billing-period counting / limiter workloads) don’t degrade into collection scans, reducing CPU/memory pressure.

Changes:

  • Create a timestamp index on the per-project repetitions:<projectId> collection during project creation.
  • Bump package version from 1.4.13 to 1.4.14.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/resolvers/project.js Adds creation of a timestamp index on repetitions:<projectId> when a project (and its collections) is created.
package.json Version bump to 1.4.14.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/resolvers/project.js
Copilot finished work on behalf of neSpecc May 5, 2026 14:29
Copilot AI requested a review from neSpecc May 5, 2026 14:29
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.

4 participants