阅读背景:

在sqlite中递归进行递归计算的替代方法?

来源:互联网 

I am currently working on a project for the iPhone that requires accessing a large amount of hierarchical data stored in a local sqlite database. One of the more common operations is calculating a rollup status field. Right now, I'm doing that by recursing through all the descendants of that item (which can be anywhere from 1 to n levels deep). However, this ends up requiring a LOT of sql calls. Each sqlite call on an iPhone takes around 250ms to complete, and in the end this adds up to around 7.7 seconds of processing time. Does anyone have any suggestions of doing something like this in less than O(n) time? I think the root of the problem is the sheer number of sql calls being made, so that's what I'm looking to reduce.I am currently working on a project for the iPh




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: