
1.基本思路2.分页加载策略def search_database(query: str, limit: int 20, offset: int 0): 搜索数据库默认返回 20 条支持翻页 results db.execute(query, limitlimit, offsetoffset) return { data: results, total_count: db.count(query), has_more: offset limit db.count(query) }3.结构化截断技巧查询返回 5000 条记录以下是前 5 条示例 [前 5 条完整数据] ... 统计平均年龄 28.5 岁男女比例 6:4最活跃城市前三北京、上海、深圳4.引用机制与按需读取5.多级压缩策略6.流式处理与提前终止7.追问