简体   繁体   English

Android sqlite中的大量数据

[英]large amount of data in android sqlite

I am designing an application that require to store data in one Sqlite table in android 4.2+ and regularly fetch some of the data among them. 我正在设计一个应用程序,该应用程序需要将数据存储在android 4.2+中的一个Sqlite表中,并定期获取其中的一些数据。 Maximum amount of data could be near 100K records, and the number of columns of each record is 6 String and Integer. 最大数据量可能接近10万条记录,每条记录的列数为6字符串和整数。 I want to know how can I efficiently read some data from this table of 100K records? 我想知道如何有效地从此100K记录表中读取一些数据? (I want to use the application on the tablet with 1GB of RAM and a Quad core cpu 1.2GH). (我想在具有1GB RAM和Quad core cpu 1.2GH的平板电脑上使用该应用程序)。 If it is not possible, could archiving some old data make the performance better? 如果不可能,将一些旧数据存档是否可以改善性能? I can create an archive table and move old data (low rate accessed data) into this new table 我可以创建一个存档表并将旧数据(访问率较低的数据)移到这个新表中

thanks in advance 提前致谢

Clarification---- is searching among 100K records too expensive for a mobile device with mentioned config? 澄清----对于具有上述配置的移动设备,在10万条记录中搜索是否太昂贵? can search be done in less than 2 sec? 可以在不到2秒的时间内完成搜索? has anyone similar experience for searching among thousands of record in a mobile device? 有没有类似的经验可以在移动设备中的数千条记录中进行搜索?

A query like this: 这样的查询:

SELECT * FROM MyTable WHERE SomeColumn = ?

can be executed very efficiently if SomeColumn is indexed, either because it is the PRIMARY KEY, or because you created an index explicitly. 如果为SomeColumn索引,则可以非常有效地执行SomeColumn索引,这是因为它是PRIMARY KEY,或者是因为您显式创建了索引

You can make a data base of Strings and integers as much as you need and search would not take such long time but notice that your values must be characters not picture or byte data if you want use such data you must store them on sd card and use the address of that data You also can make your data base in your pc by sqlmanager and push it in your app 您可以根据需要创建字符串和整数的数据库,并且搜索不会花费那么长时间,但是请注意,如果您想使用此类数据,则必须将其值存储为sd卡,并且您的值必须为字符而不是图片或字节数据。使用该数据的地址您还可以通过sqlmanager在您的PC中建立数据库并将其推送到您的应用程序中

Here you can find a sample code of sqlilte . 在这里,您可以找到sqlilte的示例代码。

http://www.codeproject.com/Articles/783073/A-Simple-Android-SQLite-Example http://www.codeproject.com/Articles/783073/A-Simple-Android-SQLite-Example

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM