On 03/05/2014 03:05 AM, Eduardo Morras wrote:
On Tue, 4 Mar 2014 15:19:24 +0000
Simon Slavin <slav...@bigfraud.org> wrote:
On 4 Mar 2014, at 3:15pm, Simon Slavin <slav...@bigfraud.org> wrote:
On 4 Mar 2014, at 3:09pm, Eduardo Morras <emorr...@yahoo.es> wrote:
zSql= "SELECT r.name, s.content FROM resource AS r, static AS s
WHERE (r.ids = s.ids AND r.name = ?);";
[snip]
Error on query: out of memory
I think this might require comparing every row in resource with
every row in static. Which is a lot of temporary data to hold in
memory.
You might try something like
SELECT r.name, s.content FROM resource AS r JOIN static AS s ON
s.ids = r.ids WHERE r.name = ?
and, of course, an index
CREATE INDEX i1 on resource (name,ids)
will make it run extremely quickly.
I'll reply both answers here, if you don't mind.
Thanks Simon, for the answers.
The tables have 4 rows each one, that's why I got suprised with the Out of
Memory error. The biggest row has 12KB and with the join I do, shouldn't use
more than 200KB.
Changing the ',' with the join you propose, gives Out of Memory too. It happens
on prepare phase, before binding the ? with my data. The query didn't reach the
step call.
Trying simple "SELECT r.name FROM resource AS r WHERE r.name = ?" gets "Out of
memory" too calling preparev2.
Does the "out of memory" error come from sqlite3_prepare_v2()
directly or from sqlite3_errmsg()? Is the sqlite3* pointer
a NULL?
Dan.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users