SQLite或Core Data用于只有查询的大型数据库 [英] SQLite or Core Data for large database with only queries

查看:132
本文介绍了SQLite或Core Data用于只有查询的大型数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

基本上,我写一个iOS应用程序,使用一个巨大的数据库,根本不会被编辑。在这两者之间,我寻找更快的查询速度。我从来没有使用任何SQLite或Core Data在我的开发生命周期,所以在我潜水写任何东西之前,我想知道这些(或任何替代品)将更好的我的任务。

Basically, I'm writing an iOS app that makes use of a huge database that will not be edited at all. Between these two, I'm looking for faster query speeds. I have never used any SQLite or Core Data in my developing lifetime, so before I take a dive writing anything, I want to find out which of these (or if any alternatives) would be better for my task.

任何效果数据或建议都将非常感谢。

Any performance data or suggestions would be greatly appreciated.

编辑:SQLite和Core Data都不能以提供我需要的性能(虽然SQLite表现更好)。我决定使用SQLite(使用FMDB)并使用多线程来摆脱在多次查询时出现的问题。

Neither SQLite nor Core Data was able to deliver the performance I needed (although SQLite performed better). I decided to go with SQLite (with FMDB) and use multi-threading to get rid of stutters that occur when querying multiple times.

推荐答案

p>它取决于你想要如何管理数据,如果你想要一个关系数据库,使用sqlite,如果你想保存模型对象(在模型 - 视图 - 控制器设计模式的意义上)到一个文件,并获得它们再次使用Core Data。

It depends on how you want to manage your data, if you want a relational database, use sqlite and if you want to save model objects (in the sense of the model-view-controller design pattern) to a file and get them back again, use Core Data.

根据我两者对于大数据库都是一样的,在sqlite中,你可以使用事务更快地获取大量数据。

According to me both are same for large database, in sqlite you can use transactions for getting huge data faster.

链接可能会帮助您更好。

This link might helps you better.

希望这会帮助你。

这篇关于SQLite或Core Data用于只有查询的大型数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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