Re: [sqlite] SQLite takes too much memory

2008-06-28 Thread Mihai Limbasan
Jonas Sandman wrote: > You are creating 100 prepared statements, which probably takes a lot of > memory. > What you really want to do is probably create one statement, get all > the data out of it, finalize it and then prepare the next statement > and get THAT data etc. > The posted code does

Re: [sqlite] Lemon

2008-06-28 Thread Arjen Markus
> Hi, > Can u send me any documentation on LEMON that u have worked out. > I have some queries also. > 1.Does LEMON work on Windows environment? > 2.I tried but it is not.I heard that it works on Linux environment.I am > trying to know why not on windows...can u give me some info about it > >

Re: [sqlite] Using SQLite in embedded environment

2008-06-28 Thread Steven Woody
On Sat, Jun 28, 2008 at 11:30 AM, dcharno <[EMAIL PROTECTED]> wrote: >> As an option, we also think about Berkeley DB, do you experts has >> experience using Berkeley DB on ARM/Linux with ulibc or glibc? > > Berkeley DB may also be an option. It really depends upon what you are > trying to

Re: [sqlite] Index and ORDER BY

2008-06-28 Thread Alexey Pechnikov
В сообщении от Saturday 28 June 2008 02:28:05 Jeff Gibson написал(а): > I have a large table and a two column index: How much rows are you have? ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Index and ORDER BY

2008-06-28 Thread Alexey Pechnikov
В сообщении от Saturday 28 June 2008 02:28:05 Jeff Gibson написал(а): > When I do the following query: > > SELECT events.* FROM events WHERE ( events.type=22) AND ( events.tid=9) > AND (events.eid<=3261976) AND (events.verbose<=1) ORDER BY events.eid > DESC LIMIT 1; > > it's very slow.  If I

Re: [sqlite] SQL questions

2008-06-28 Thread Alexey Pechnikov
В сообщении от Saturday 28 June 2008 01:20:49 John Stanton написал(а): > I have seen such indices.  The key is evaluated at the time the record > is inserted and an index built.  The poster could use a trigger with an > update to place the evaluated expression into a colum. Excellent! It's

Re: [sqlite] Using SQLite in embedded environment

2008-06-28 Thread dcharno
Steven Woody wrote: > On Sat, Jun 28, 2008 at 11:30 AM, dcharno <[EMAIL PROTECTED]> wrote: >>> As an option, we also think about Berkeley DB, do you experts has >>> experience using Berkeley DB on ARM/Linux with ulibc or glibc? >> Berkeley DB may also be an option. It really depends upon what you

Re: [sqlite] SQLite takes too much memory

2008-06-28 Thread Jonas Sandman
On Sat, Jun 28, 2008 at 8:43 AM, Mihai Limbasan <[EMAIL PROTECTED]> wrote: > The posted code does not create 100 prepared statements. It creates just > one, fetches the data, finalizes the statement, then loops. Very true, my mistake. /Jonas ___

Re: [sqlite] Index and ORDER BY

2008-06-28 Thread Emilio Platzer
(sorry about my poor english) I think that the problem doesn't correct by creating a DESC index. The problema was at de 'where clausula': (events.eid<=3261976) For some reason SQLITE doesn't optimize the query to use the index to locate the last index item that have type=22 and eid<=3261976.

Re: [sqlite] Index and ORDER BY

2008-06-28 Thread jsg72
16 million On Jun 28, 2008, at 4:25 AM, Alexey Pechnikov wrote: > В сообщении от Saturday 28 June 2008 02:28:05 Jeff Gibson > написал(а): >> I have a large table and a two column index: > > How much rows are you have? > ___ > sqlite-users mailing

Re: [sqlite] Index and ORDER BY

2008-06-28 Thread jsg72
Sounds promising. I'll give it a try. Thanks! Jeff On Jun 28, 2008, at 4:29 AM, Alexey Pechnikov wrote: > В сообщении от Saturday 28 June 2008 02:28:05 Jeff Gibson > написал(а): >> When I do the following query: >> >> SELECT events.* FROM events WHERE ( events.type=22) AND >> (

Re: [sqlite] Index and ORDER BY

2008-06-28 Thread jsg72
I tried taking the tid and verbose tests out of the WHERE clause, and it made very little difference in the performance. I was thinking that if I can at least speed it up with just eid and type, I could try to extend it to the other columns. Thanks, Jeff On Jun 28, 2008, at

Re: [sqlite] Index and ORDER BY

2008-06-28 Thread jsg72
Very strange. I modified my query to not use verbose or tid, so only the indexed columns are relevant. With: CREATE INDEX ev4_idx ON events(type); The query runs in about 9 seconds. With: CREATE INDEX ev4_idx ON events(type,eid desc) It runs in 11 seconds. I'm not using the most accurate

Re: [sqlite] Index and ORDER BY

2008-06-28 Thread Alexey Pechnikov
Can you send link to you database file? You results are strange. В сообщении от Saturday 28 June 2008 21:44:15 [EMAIL PROTECTED] написал(а): > Very strange. I modified my query to not use verbose or tid, so only > the indexed columns are relevant. > > With: > > CREATE INDEX ev4_idx ON

Re: [sqlite] Index and ORDER BY

2008-06-28 Thread Alexey Pechnikov
Show results of this queries: select max(eid) from events; select count(eid) from events; select count(eid) from events where type=22; select count(eid) from events where eid<=3261976; select count(eid) from events where eid<=3261976 and type=22; ___

Re: [sqlite] Index and ORDER BY

2008-06-28 Thread jsg72
sqlite> SELECT max(eid) from events; 16643833 sqlite> SELECT count(eid) FROM events; 16643833 sqlite> SELECT count(eid) FROM events WHERE type=22; 8206183 sqlite> SELECT count(eid) FROM events WHERE eid<=3261976; 3261976 sqlite> SELECT count(eid) FROM events WHERE eid<=3261976 AND type=22;

[sqlite] rtree module crashes

2008-06-28 Thread Hartwig Wiesmann
When I compile SQLite using SQLITE_ENABLE_RTREE set to 1 SQLite will crash when opening a database (Mac OSX). The reason seems to be that in rtree.c sqlite3ext.h is included instead of sqlite3.h. This can be prevented by setting SQLITE_CORE to 1 but then the types i64, u8 etc. are

[sqlite] Unsigned 64 bit integers

2008-06-28 Thread freeav8r
Hi. I have a newbie question. When trying to store 64-bit unsiged integers in sqlite, some of them come back as floats. There is some internal reference on the web page to 64-bit unsiged integers; http://www.sqlite.org/c3ref/int64.html. On the other hand, the faq's entry on AUTOINCREMENT

Re: [sqlite] Lemon

2008-06-28 Thread arjunkumar keerti
Hi Arjen, Thanks for the mail...I found it very helpful and i started to execute it..I succeeded in doing it... However i started writing a sample program for converting "Infix to Prefix"...I am struck at this point ...so can u help me in writing this program... Thanks in advance

Re: [sqlite] Unsigned 64 bit integers

2008-06-28 Thread Alex Katebi
No. The range is for 64 bit signed. SQLite has manifest typing it is like Ruby Duck Typing or Dynamic Typing. The value defines the type not the column type or lack there of it. If you value is a small integer it will only use 1 byte. On Sat, Jun 28, 2008 at 6:02 PM, freeav8r <[EMAIL PROTECTED]>

Re: [sqlite] Using SQLite in embedded environment

2008-06-28 Thread Steven Woody
On Sat, Jun 28, 2008 at 8:37 PM, dcharno <[EMAIL PROTECTED]> wrote: > Steven Woody wrote: >> On Sat, Jun 28, 2008 at 11:30 AM, dcharno <[EMAIL PROTECTED]> wrote: As an option, we also think about Berkeley DB, do you experts has experience using Berkeley DB on ARM/Linux with ulibc or

[sqlite] select with union fails on an attached database for 500 records

2008-06-28 Thread Naganathan Rajesh
Hi All, We are facing a problem with the select command with union on an attached database and getting an error "SQL logic error or missing database" 1.We have an active database connection (for eg a.db which contains a table with following columns)CREATE TABLE Contact_Primary_Info([uid]

Re: [sqlite] rtree module crashes

2008-06-28 Thread Dan
On Jun 29, 2008, at 3:02 AM, Hartwig Wiesmann wrote: > When I compile SQLite using SQLITE_ENABLE_RTREE set to 1 SQLite will > crash when opening a database (Mac OSX). The reason seems to be that > in rtree.c sqlite3ext.h is included instead of sqlite3.h. This can be > prevented by setting