English 中文(简体)
页: 1
原标题:lua and lsqlite3: speeding up select statement

I m使用Lsqlite3 lua包,I m将查询输入数据库。 我的亚洲开发银行有约5百万分行,用于检索浏览器的Im代码类似于:

db = lsqlite3.open( mydb )
local temp = {}
local sql = "SELECT A,B FROM tab where FOO=BAR ORDER BY A DESC LIMIT N"
for row in db:nrows(sql) do temp[row[ key ]] = row[ col1 ] end

你可以看到我试图获得顶层<代码>。 缩略语 (我想接上头几行,然后采用LIMIT<>/code>,而不是其他方式。) 页: 1 A,但似乎没有什么变化。 我如何能够更快地做到这一点?

最佳回答

您需要将您筛选的栏目(即与WHERE条款)加以索引。 原因之一是,光电灯在<>>> 之后/> 过滤器上,而不是其他方式。

因此,你可能应当制定财务监督制度指数。

您的表象是怎样的?

<>>>>>

也可以增加sqlite cache ,例如:

PRAGMA cache_size=100000

你们可以根据现有的记忆和贵国数据库的规模来调整。

<><>UPDATE 2>

您希望能更好地了解一下你是如何用lit子处理问题的。

rel=“nofollow”>http://www.sqlite.org/eqp.html

<>9>

我没有在初步答复中适当理解你的情况。 如果你要用一些大型数据组填写,你可能希望使用该指数,而不是以前的指数,这样你就可以告诉大家不要使用FOO指数:

SELECT a, b FROM foo WHERE +a > 30 ORDER BY b
问题回答

暂无回答




相关问题
what is wrong with this mysql code

$db_user="root"; $db_host="localhost"; $db_password="root"; $db_name = "fayer"; $conn = mysqli_connect($db_host,$db_user,$db_password,$db_name) or die ("couldn t connect to server"); // perform query ...

Users asking for denormalized database

I am in the early stages of developing a database-driven system and the largest part of the system revolves around an inheritance type of relationship. There is a parent entity with about 10 columns ...

Easiest way to deal with sample data in Java web apps?

I m writing a Java web app in my free time to learn more about development. I m using the Stripes framework and eventually intend to use hibernate and MySQL For the moment, whilst creating the pages ...

join across databases with nhibernate

I am trying to join two tables that reside in two different databases. Every time, I try to join I get the following error: An association from the table xxx refers to an unmapped class. If the ...

How can I know if such value exists in database? (ADO.NET)

For example, I have a table, and there is a column named Tags . I want to know if value programming exists in this column. How can I do this in ADO.NET? I did this: OleDbCommand cmd = new ...

Convert date to string upon saving a doctrine record

I m trying to migrate one of my PHP projects to Doctrine. I ve never used it before so there are a few things I don t understand. In my current code, I have a class similar to this: class ...