你人生中的每次付出都是值得的。
当然,该代码片段每次执行时,您仍然要付出分配、初始化和回收一次的代价(尽管如此,这仍然要比每次执行循环时付出相应的代价更好一些)。
Of course, you still pay for a single allocation, initialization, and collection each time this code snippet is executed (though that's still better than paying for it every time through the loop).
这些常见的查询与总数没有任何关系,但每次却都要返回总数,这就需要付出代价。
Neither of these common queries care about total, but they're paying the cost of fetching it each time.
应用推荐