Commit fdaa5b3
authored
Optimize query for getting tags for a level (#943)
Optimizes the query used to get the tags for a level. After adding a few
tag relations to a few levels on my server and then doing similar
testing as in #842, I've got the following results:
With the new query:
```
[09/05/25 11:12:42] [Info] [Request] Served request to 127.0.0.1:36562: 200 OK on GET '/api/v3/levels/newest?count=100' (260ms)
[09/05/25 11:12:42] [Info] [Request] Served request to 127.0.0.1:36584: 200 OK on GET '/api/v3/levels/newest?count=100' (262ms)
[09/05/25 11:12:43] [Info] [Request] Served request to 127.0.0.1:36608: 200 OK on GET '/api/v3/levels/newest?count=100' (250ms)
[09/05/25 11:12:43] [Info] [Request] Served request to 127.0.0.1:36626: 200 OK on GET '/api/v3/levels/newest?count=100' (260ms)
[09/05/25 11:12:44] [Info] [Request] Served request to 127.0.0.1:36650: 200 OK on GET '/api/v3/levels/newest?count=100' (255ms)
```
With the old query:
```
[09/05/25 11:13:00] [Info] [Request] Served request to 127.0.0.1:34600: 200 OK on GET '/api/v3/levels/newest?count=100' (504ms)
[09/05/25 11:13:01] [Info] [Request] Served request to 127.0.0.1:34608: 200 OK on GET '/api/v3/levels/newest?count=100' (500ms)
[09/05/25 11:13:01] [Info] [Request] Served request to 127.0.0.1:34626: 200 OK on GET '/api/v3/levels/newest?count=100' (491ms)
[09/05/25 11:13:02] [Info] [Request] Served request to 127.0.0.1:34652: 200 OK on GET '/api/v3/levels/newest?count=100' (505ms)
[09/05/25 11:13:03] [Info] [Request] Served request to 127.0.0.1:34664: 200 OK on GET '/api/v3/levels/newest?count=100' (507ms)
```3 files changed
Lines changed: 12 additions & 15 deletions
File tree
- Refresh.Database
- Refresh.Interfaces.APIv3/Endpoints/DataTypes/Response/Levels
- Refresh.Interfaces.Game/Types/Levels
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
748 | 748 | | |
749 | 749 | | |
750 | 750 | | |
751 | | - | |
752 | | - | |
753 | | - | |
754 | | - | |
755 | | - | |
756 | | - | |
757 | | - | |
758 | | - | |
759 | | - | |
760 | | - | |
761 | | - | |
762 | | - | |
763 | | - | |
| 751 | + | |
| 752 | + | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
764 | 761 | | |
765 | 762 | | |
766 | 763 | | |
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
100 | 100 | | |
101 | 101 | | |
102 | 102 | | |
103 | | - | |
| 103 | + | |
104 | 104 | | |
105 | 105 | | |
106 | 106 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
| 187 | + | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| |||
0 commit comments