5 Commits

Author SHA1 Message Date
Hermes Agent
1aa28430e0 refactor: appcodes编码改用models codes段定义,清理json alters 2026-06-17 19:09:51 +08:00
d4e455ba9a perf: optimize get_inference_history query and add indexes
Query optimization (dspy):
- Replace UNION ALL + sort with two parallel queries (asyncio.gather)
  that each use (userid, use_time) composite index
- Python-side merge-sort of two pre-sorted sequences O(n)
- Concurrent FileStorage reads for ioinfo (asyncio.gather)

Indexes (models/*.json + /tmp/llmage_history_indexes.sql):
- llmusage: add idx_llmusage_userid_usetime (userid, use_time)
- llmusage_history: add idx_lh_userid_usetime (userid, use_time)
  (was missing userid index entirely - main bottleneck)
2026-06-05 17:42:15 +08:00
d44c2dae74 refactor(models): convert to json format per database-table-definition-spec 2026-05-27 13:23:28 +08:00
9fa8f9fa62 feat(llmage): 日期变更触发备份(use_date<昨天) + llmusage添加(accounting_status,use_date)组合索引 2026-05-24 17:21:34 +08:00
81bed1d384 feat: add json table definitions for all models (converted from xlsx) 2026-05-21 12:46:20 +08:00