- Notifications
You must be signed in to change notification settings - Fork1k
Commit4fab14b
authored
fix: limit the scope of the template average build time query to the last 100 (#19648)
This PR shouldresolvecoder/internal#719 bylimiting the `workspace_builds` rows selected by the query to the mostrecent 100 builds of a template, as opposed to all builds in the last30d. For our own internal templates with the most builds (1700-2000 in a30d period) this should cut the query execution time by about 80%.Unless we have some restriction on keeping the 30d period, contractrelated or otherwise, this seems like a safe change to make. In additionto the execution speed improvements it also means the memory for thequery is bounded as well.If we want to keep a 30d time period for the avg build time value Ithink it's worth exploring a purpose built solution such as histogramstructures where the build times could be bucketized by template ID asthey're observed.---------Signed-off-by: Callum Styan <callumstyan@gmail.com>1 parent6574299 commit4fab14b
File tree
8 files changed
+15
-24
lines changed- coderd
- database
- dbauthz
- dbmetrics
- dbmock
- queries
- metricscache
8 files changed
+15
-24
lines changedOriginal file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
2792 | 2792 |
| |
2793 | 2793 |
| |
2794 | 2794 |
| |
2795 |
| - | |
| 2795 | + | |
2796 | 2796 |
| |
2797 | 2797 |
| |
2798 | 2798 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3160 | 3160 |
| |
3161 | 3161 |
| |
3162 | 3162 |
| |
3163 |
| - | |
| 3163 | + | |
3164 | 3164 |
| |
3165 | 3165 |
| |
3166 | 3166 |
| |
|
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
203 | 203 |
| |
204 | 204 |
| |
205 | 205 |
| |
206 |
| - | |
207 | 206 |
| |
208 | 207 |
| |
209 | 208 |
| |
210 | 209 |
| |
| 210 | + | |
211 | 211 |
| |
212 | 212 |
| |
213 | 213 |
| |
|
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
101 | 101 |
| |
102 | 102 |
| |
103 | 103 |
| |
104 |
| - | |
105 |
| - | |
| 104 | + | |
| 105 | + | |
106 | 106 |
| |
107 | 107 |
| |
108 | 108 |
| |
109 |
| - | |
110 |
| - | |
111 |
| - | |
112 |
| - | |
113 |
| - | |
| 109 | + | |
114 | 110 |
| |
115 | 111 |
| |
116 | 112 |
| |
|
0 commit comments
Comments
(0)