English 中文(简体)
查询 Sqlite 中若干行的定购数据速度更快吗?
原标题:query a number of rows in sqlite ordered data faster?

我有一个 sqlite db, 数据是由一个字符串字段订购的。 我想从某个字符串字段的字典顺序中取回从某个开始的行数。 现在我使用 liMIT 查询, 但我对速度不满意。 我认为只搜索第一个, 然后告诉 sqlite 获得行数跟踪更好, 我怎么能这样做? (我的英语不好, 如果错了, 抱歉)

问题回答

我不确定你的意思,但我会试着回答,如果我偏离轨道,请提前表示歉意。

考虑一下您的字符串列被称为线条。 如果您想要在用特定顺序选择时有良好的性能, 您必须在要排序的列上有一个索引 。

您的查询将看起来像 :

SELECT *
FROM mytable
ORDER BY mystring
LIMIT 5,10

这是最快的解决办法。





相关问题
Spring Properties File

Hi have this j2ee web application developed using spring framework. I have a problem with rendering mnessages in nihongo characters from the properties file. I tried converting the file to ascii using ...

Logging a global ID in multiple components

I have a system which contains multiple applications connected together using JMS and Spring Integration. Messages get sent along a chain of applications. [App A] -> [App B] -> [App C] We set a ...

Java Library Size

If I m given two Java Libraries in Jar format, 1 having no bells and whistles, and the other having lots of them that will mostly go unused.... my question is: How will the larger, mostly unused ...

How to get the Array Class for a given Class in Java?

I have a Class variable that holds a certain type and I need to get a variable that holds the corresponding array class. The best I could come up with is this: Class arrayOfFooClass = java.lang....

SQLite , Derby vs file system

I m working on a Java desktop application that reads and writes from/to different files. I think a better solution would be to replace the file system by a SQLite database. How hard is it to migrate ...

热门标签