Android的表现:平面文件VS的SQLite平面、文件、Android、VS

2023-09-04 11:10:23 作者:安小熙

有相关的计算器这个话题几个问题,但我没有得到正确的答案。我对平面文件的性能有些疑惑,是更好地使用平面文件而不是的SQLite ?任何人都可以拥有性能统计信息?适当的方式在Android的code平面文件或示例。

There are few questions related to this topic on stackoverflow, But I didn't get the proper answer. I have some doubts on performance of flat files, Is it better to use flat files instead of SQLite ? Can anybody have performance statistics ? Or example of proper way to code flat file in android.

推荐答案

除了性能优势,这里有使用SQLite而不是平面文件的优势,一个简单的列表:

Aside from performance benefits, here's a simple list of advantages of using SQLite rather than flat file:

您可以查询的项目,如你所愿 - 不需要加载所有这些,选择你需要哪些。 记录删除是一个更痛苦的过程。不重写整个文件到任何地方。 更新记录是去掉或建立一个作为简单。 你有没有尝试过做交叉参考查找上的平面文件? Just.Not.Worth.It。

总之,这是一个数据库有超过一个文本文件中的每个优势。

To summarize, it's every advantage a Database has over a text file.