TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Ask HN: Does an application-level query optimizer like this exist?

1 点作者 mnoronha9 个月前
Recently, I did a round of optimizations on an old side-project. There turned out to be two types of changes I made which made the bulk of the difference:<p>1) Rewriting queries that were pulling data out of the DB that wasn&#x27;t all used 2) Adding in-memory caching for repeated queries<p>A possible third, which I didn&#x27;t need but could see being beneficial:<p>3) Querying data in bulk when possible (e.g. n users each make the same query for their version of some data, which could instead be made in one bulk query and then stored in memory and parceled out to each user)<p>In principle, for this simple app all three of these optimizations could have been made through a tool that looks at user code, request runtime, and a list of all queries being made and the time spent on each one. My process was to make one of the optimizations, rerun through some representative workflows, and verify that everything still worked and that runtimes &#x2F; queries made changed in the way I expected.<p>This process felt formulaic but time-consuming (to make sure things like invalidation were done correctly). It seems like there&#x27;s a lot of tooling out there that can point you at slow queries. Are there any linters &#x2F; tools which go far enough to drive most of the optimization loop themselves?

暂无评论

暂无评论