Files
new-api/controller
t0ng7u 195be56c46 🏎️ perf: optimize aggregated model look-ups by batching bound-channel queries
Summary
-------
1. **Backend**
   • `model/model_meta.go`
     – Add `GetBoundChannelsForModels([]string)` to retrieve channels for multiple models in a single SQL (`IN (?)`) and deduplicate with `GROUP BY`.

   • `controller/model_meta.go`
     – In non-exact `fillModelExtra`:
       – Remove per-model `GetBoundChannels` calls.
       – Collect matched model names, then call `GetBoundChannelsForModels` once and merge results into `channelSet`.
       – Minor cleanup on loop logic; channel aggregation now happens after quota/group/endpoint processing.

Impact
------
• Eliminates N+1 query pattern for prefix/suffix/contains rules.
• Reduces DB round-trips from *N + 1* to **1**, markedly speeding up the model-management list load.
• Keeps existing `GetBoundChannels` API intact for single-model scenarios; no breaking changes.
2025-08-10 23:11:35 +08:00
..
2024-12-29 16:50:26 +08:00
2025-08-07 01:11:01 +08:00
2025-03-15 19:10:12 +08:00
2025-08-10 12:11:31 +08:00
2025-08-08 11:59:04 +08:00
2025-08-10 12:11:31 +08:00
2025-08-10 12:11:31 +08:00
2025-08-09 00:27:33 +08:00
2025-07-24 10:14:25 +08:00
2025-07-22 20:14:24 +08:00
2024-09-25 17:15:59 +08:00
2025-07-10 20:55:43 +08:00
2025-08-10 12:11:31 +08:00
2025-08-10 12:11:31 +08:00