Android SQLite光标会一次将所有记录加载到内存中吗? [英] Does Android SQLite cursor load all records into memory at once?

查看:132
本文介绍了Android SQLite光标会一次将所有记录加载到内存中吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android SQLite游标是否将查询的所有数据加载到内存中,还是在实现中包含某种优化策略?

Does an Android SQLite cursor load all data for a query into memory, or is there some sort of optimization strategy that's part of its implementation?

推荐答案

SQLiteCursor在您浏览数据时会在窗口"中填充数据.我的回忆是窗口大小为1MB,但是我无法将您指向支持该回忆的特定代码.因此,对于小型查询,最终效果是,一旦开始访问行和列,SQLiteCursor会将整个结果集保存在内存中.

A SQLiteCursor fills a "window" with data as you navigate through it. My recollection is that the window size is 1MB, but I can't point you to specific code that backs up that recollection. So, for small queries, the net effect is that the SQLiteCursor will hold the entire result set in memory, once you start accessing rows and columns.

这篇关于Android SQLite光标会一次将所有记录加载到内存中吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆