Commit 86e4c08
committed
perf(webapp): look up environments by indexed organization column
The metric endpoint built its environment field mappings with a
`where: { project: { organizationId } }` filter, which joins through the
projects table on every request. RuntimeEnvironment has its own non-null,
indexed organizationId column that is always set to the same organization
as the environment's project, so filter on it directly instead.
Returns the same set of environments with less work per request.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01B6byUe71HjFpnGAsicw7Hy1 parent 8f66af6 commit 86e4c08
2 files changed
Lines changed: 8 additions & 1 deletion
File tree
- .server-changes
- apps/webapp/app/services
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
359 | 359 | | |
360 | 360 | | |
361 | 361 | | |
362 | | - | |
| 362 | + | |
| 363 | + | |
363 | 364 | | |
364 | 365 | | |
365 | 366 | | |
| |||
0 commit comments