Skip to content

Stop counting unused appdata#4062

Merged
MartinquaXD merged 1 commit intomainfrom
stop-counting-unused-appdata
Jan 19, 2026
Merged

Stop counting unused appdata#4062
MartinquaXD merged 1 commit intomainfrom
stop-counting-unused-appdata

Conversation

@MartinquaXD
Copy link
Copy Markdown
Contributor

Description

According to RDS metrics a relatively high amount of DB load gets caused by a query counting how many appdatas have never been used in an order.
This query takes ~4s on the read replica. While I originally worked on speeding up the query (a simple index produced good results) I think it probably makes more sense to remove this logic altogether.
We've never paid attention to this metric so why pay with DB load for something we don't use?

Changes

Dropped code to count unused appdatas in the DB metrics.

@MartinquaXD MartinquaXD requested a review from a team as a code owner January 16, 2026 20:59
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request removes the logic for counting unused appdata entries, which was identified as a source of significant database load. The changes are straightforward and effectively eliminate an expensive, unused query. By removing the count_unused_app_data function and the associated unused_app_data metric, this PR provides a clean and beneficial performance optimization. The code removal is complete and I found no issues with the implementation.

Copy link
Copy Markdown
Contributor

@jmg-duarte jmg-duarte left a comment

Choose a reason for hiding this comment

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

🧹

@MartinquaXD MartinquaXD added this pull request to the merge queue Jan 19, 2026
Merged via the queue into main with commit e96e54b Jan 19, 2026
19 checks passed
@MartinquaXD MartinquaXD deleted the stop-counting-unused-appdata branch January 19, 2026 14:43
@github-actions github-actions Bot locked and limited conversation to collaborators Jan 19, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants