[sqlite] memsys3 vs memsys5

2008-09-09 Thread Dave Toll
Hello list I'm using SQLite 3.6.2 on an embedded C platform, and I recently switched from memsys3 to memsys5. SQLite memory usage (sqlite3_memory_used()) for a fully-cached database nearly doubled from 4.7MB to 8.9MB (using the same DB file in each test). Is this normal/expected? I've also

Re: [sqlite] Error A0A

2008-09-09 Thread rrrado2
I'm using some wrapper but modified. Here is my Exec method: while(1) { rc = _sqlite3_step(m_stmt); if (rc == SQLITE_ROW) return 1; if (rc == SQLITE_DONE) { _sqlite3_reset(m_stmt); return 0;

[sqlite] Bigger table and query optimization

2008-09-09 Thread Bruno Moreira Guedes
Hi people!! I'm getting problems with a bigger table. I'm doing a query like this: SELECT field FROM tables WHERE '%.' || somefield LIKE 'somestring' The table has about 500.000 registers. When the table is short, it's too fast, but when it's populated it gets slow. I've been imagined it

Re: [sqlite] Bigger table and query optimization

2008-09-09 Thread P Kishor
On 9/9/08, Bruno Moreira Guedes <[EMAIL PROTECTED]> wrote: > Hi people!! > > I'm getting problems with a bigger table. I'm doing a query like this: > > SELECT field FROM tables WHERE '%.' || somefield LIKE 'somestring' interesting variation on the syntax. Usually one would WHERE somefield LIKE

Re: [sqlite] Bigger table and query optimization

2008-09-09 Thread Bruno Moreira Guedes
2008/9/9 P Kishor <[EMAIL PROTECTED]>: > On 9/9/08, Bruno Moreira Guedes <[EMAIL PROTECTED]> wrote: >> Hi people!! >> >> I'm getting problems with a bigger table. I'm doing a query like this: >> >> SELECT field FROM tables WHERE '%.' || somefield LIKE 'somestring' > > interesting variation on

Re: [sqlite] Bigger table and query optimization

2008-09-09 Thread Igor Tandetnik
"Bruno Moreira Guedes" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Yes... I need to get the rows where 'something' ENDS wifh > '.[field-value]'. But I really think this solution isn't very well. Can field-value contain a period? If not, you can just extract the portion of

Re: [sqlite] Bigger table and query optimization

2008-09-09 Thread Bruno Moreira Guedes
2008/9/9 Igor Tandetnik <[EMAIL PROTECTED]>: > "Bruno Moreira Guedes" > <[EMAIL PROTECTED]> wrote in message > news:[EMAIL PROTECTED] >> Yes... I need to get the rows where 'something' ENDS wifh >> '.[field-value]'. But I really think this solution isn't very well. > > Can field-value contain a

Re: [sqlite] Error A0A

2008-09-09 Thread Dennis Cote
[EMAIL PROTECTED] wrote: > I'm using some wrapper but modified. > Here is my Exec method: > > > if ( rc == SQLITE_BUSY) > { > Sleep(0); > rc = _sqlite3_reset(m_stmt); > continue; > } > You should not be resetting the prepared

Re: [sqlite] Bigger table and query optimization

2008-09-09 Thread Dennis Cote
Bruno Moreira Guedes wrote: > > I can split my 'something' in st0, st1, st2, stN... I have a '.' > betwen this values. But the number of "st"s is undefined. I tried to > do "the necessary" number comparsions, appending tokens: > > SELECT fields FROM sometable WHERE field = 'st0.st1.st2.st3' OR

Re: [sqlite] memsys3 vs memsys5

2008-09-09 Thread D. Richard Hipp
On Sep 8, 2008, at 8:28 PM, Dave Toll wrote: > Hello list > > > > I'm using SQLite 3.6.2 on an embedded C platform, and I recently > switched from memsys3 to memsys5. SQLite memory usage > (sqlite3_memory_used()) for a fully-cached database nearly doubled > from > 4.7MB to 8.9MB (using the

[sqlite] Insert statement is ok but after reopening the db data is missing ?

2008-09-09 Thread Lothar Behrens
Hi, I am still struggle with my insert statement with bound parameters that - followed step by step in the VDBE - seems to be inserted but is not available after closing the database. (Checked with sqliteman) I have also created a small test application using my database API wrappers. In

Re: [sqlite] Insert statement is ok but after reopening the db data is missing ?

2008-09-09 Thread Dennis Cote
Lothar Behrens wrote: > > Does someone have any more ideas how to narrow the problem ? > (After the insert statement until to closing of that file) > Try executing "pragma database_list;" after the insert. Double check the file name and path shown for the main database and ensure that is the

[sqlite] Question about vacuum

2008-09-09 Thread Ribeiro, Glauber
Hello, Here's another newbie question, but it doesn't look like the documentation for vacuum covers this. I'm using SQLite to store an application's log. Suppose I have a program that runs nightly and deletes log records that are older than 60 days, to keep the database from growing without

Re: [sqlite] Insert statement is ok but after reopening the db data is missing ?

2008-09-09 Thread Jay A. Kreibich
On Tue, Sep 09, 2008 at 04:55:01PM +0200, Lothar Behrens scratched on the wall: > I prepare an insert statement and bind the parameters that afterwards > get executed with sqlite_step(). This function then returns SQLITE_DONE > and I prepare a new select statement wich let me display the just

Re: [sqlite] Bigger table and query optimization

2008-09-09 Thread Bruno Moreira Guedes
2008/9/9 Dennis Cote <[EMAIL PROTECTED]>: > Bruno Moreira Guedes wrote: >> >> I can split my 'something' in st0, st1, st2, stN... I have a '.' >> betwen this values. But the number of "st"s is undefined. I tried to >> do "the necessary" number comparsions, appending tokens: >> >> SELECT fields

Re: [sqlite] Insert statement is ok but after reopening the db data is missing ?

2008-09-09 Thread Dennis Cote
Jay A. Kreibich wrote: > > Everything you describe sounds exactly as if a transaction has been > started, but is not committed. When you close the database, the > transaction is automatically (and correctly) rolled back. This will > also delete the journal file. > > I know you said

Re: [sqlite] Question about vacuum

2008-09-09 Thread Dan
On Sep 9, 2008, at 10:10 PM, Ribeiro, Glauber wrote: > Hello, > > Here's another newbie question, but it doesn't look like the > documentation for vacuum covers this. > > I'm using SQLite to store an application's log. Suppose I have a > program > that runs nightly and deletes log records that

Re: [sqlite] Query runs faster when repeating condition

2008-09-09 Thread Steve Friedman
Correcting a minor nit: Igor Tandetnik wrote: > Magnus Manske <[EMAIL PROTECTED]> > wrote: > The condition could be written a bit more laconically: > > pos1 BETWEEN 1 AND 100 > >> On my table (ca. 180K entries) this takes about 10 seconds for the >> above, which returns all rows. > >

Re: [sqlite] Bigger table and query optimization

2008-09-09 Thread Igor Tandetnik
Bruno Moreira Guedes <[EMAIL PROTECTED]> wrote: > I can split my 'something' in st0, st1, st2, stN... I have a '.' > betwen this values. But the number of "st"s is undefined. I tried to > do "the necessary" number comparsions, appending tokens: > > SELECT fields FROM sometable WHERE field =

[sqlite] Trim everything that is entered into database

2008-09-09 Thread Josh Millstein
Hello, Is there anyway to perform a trim to everything that is entered into a table instead of trimming before I put data in? Thanks, Josh -- ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Insert statement is ok but after reopening the db data is missing ?

2008-09-09 Thread Lothar Behrens
Am 09.09.2008 um 17:20 schrieb Dennis Cote: > Jay A. Kreibich wrote: >> >> Everything you describe sounds exactly as if a transaction has been >> started, but is not committed. When you close the database, the >> transaction is automatically (and correctly) rolled back. This will >> also

Re: [sqlite] Trim everything that is entered into database

2008-09-09 Thread Igor Tandetnik
Josh Millstein <[EMAIL PROTECTED]> wrote: > Is there anyway to perform a trim to everything that is entered into > a table instead of trimming before I put data in? I'm not sure I understand the question. Are you perhaps thinking of update mytable set myfield=trim(myfield); Igor Tandetnik

[sqlite] documentation for memsy5 PAGESIZE

2008-09-09 Thread Ken
Hi list. Just thought I'd pass this along as a suggestion: I mistakenly called: sz = pgSz * pgCache... pBuf = malloc (sz).    sqlite3_config(SQLITE_CONFIG_PAGECACHE,pBuf, sz,  pgCache  ); This functioned however the sqlite MallocInit cored due to a pageSize of 32Meg. The documentation does

Re: [sqlite] memsys3 vs memsys5

2008-09-09 Thread Ralf Junker
>> Is there any >> reliable method to determine the minimum page-cache allocation size >> needed for a given page_size? >> > >sqlite3_status(SQLITE_STATUS_PAGECACHE_SIZE, ...) Unfortunately, there is extra overhead involved which is not handled by the page cache but is allocated by malloc() if

Re: [sqlite] Bigger table and query optimization

2008-09-09 Thread Bruno Moreira Guedes
2008/9/9 Igor Tandetnik <[EMAIL PROTECTED]>: > Bruno Moreira Guedes > <[EMAIL PROTECTED]> wrote: >> I can split my 'something' in st0, st1, st2, stN... I have a '.' >> betwen this values. But the number of "st"s is undefined. I tried to >> do "the necessary" number comparsions, appending tokens:

Re: [sqlite] Trim everything that is entered into database

2008-09-09 Thread P Kishor
On 9/9/08, Josh Millstein <[EMAIL PROTECTED]> wrote: > Hello, > > Is there anyway to perform a trim to everything that is entered into a table > instead of trimming before I put data in? aren't "perform a trim to everything that is entered into a table" and "trimming before I put data in" the

[sqlite] Fwd: Insert statement is ok but after reopening the db data is missing ?

2008-09-09 Thread Lothar Behrens
> Prior post was too big :-( Here the short anser to my last try to figure out the current file name: > Now I have the result. It is the database file I am thinking to be in. > > seq name file >

Re: [sqlite] Insert statement is ok but after reopening the db data is missing ?

2008-09-09 Thread Dennis Cote
Lothar Behrens wrote: > > I have added this function right after sqlite3_step, that does the > prepared insert statement. > > int nReturn = sqlite3_step((sqlite3_stmt*)(*start)); > > int autocommit = sqlite3_get_autocommit(m_pDatabase); > > if (autocommit == 0) { >

[sqlite] char to int conversion

2008-09-09 Thread jerry
I have a CHAR field which is usually an integer. I would like to sort this field as if it is an integer so that 1a 5b 10c 12xxx does not get sorted as 10c 12xxx 1a 5b. I have successfully used something like "ORDER BY CHARFIELDNAME - 0" which seems to convert the expression to an integer the

Re: [sqlite] Trim everything that is entered into database

2008-09-09 Thread Enrique Ramirez
I'm guessing he means like automatically (IE using triggers). Which also would be my answer (use triggers). On Tue, Sep 9, 2008 at 1:52 PM, P Kishor <[EMAIL PROTECTED]> wrote: > On 9/9/08, Josh Millstein <[EMAIL PROTECTED]> wrote: >> Hello, >> >> Is there anyway to perform a trim to everything

Re: [sqlite] Insert statement is ok but after reopening the db data is missing ?

2008-09-09 Thread Lothar Behrens
Am 09.09.2008 um 20:46 schrieb Dennis Cote: > Lothar Behrens wrote: >> >> I have added this function right after sqlite3_step, that does the >> prepared insert statement. >> >> int nReturn = sqlite3_step((sqlite3_stmt*)(*start)); >> >>int autocommit =

Re: [sqlite] Insert statement is ok but after reopening the db data is missing ?

2008-09-09 Thread Dennis Cote
Lothar Behrens wrote: > > But when you say, that, if jornal files are open, transactions are > opened, I would set a > breakpoint at the line of code the transaction opens these jornal file > and I could look > arount there from who the transaction comes. > > Is that an option ? > > What

[sqlite] help with Memsys 5 and memory status variables

2008-09-09 Thread Ken
HI all, I'm trying to use the memsys5 subsystem (3.6.2). I've run the configs for the MEMSTATUS, HEAP, SCRATCHBUF: During processing I get an out of mem error returned from a select statement. Here is the output of various sqlite3 memory highwater marks. SQLITE_STATUS_MEMORY_USED [65469440]

Re: [sqlite] char to int conversion

2008-09-09 Thread Dennis Cote
jerry wrote: > I have a CHAR field which is usually an integer. I would like to sort > this field as if it is an integer so that 1a 5b 10c 12xxx does not get > sorted as 10c 12xxx 1a 5b. I have successfully used something like > "ORDER BY CHARFIELDNAME - 0" which seems to convert the

[sqlite] Re installing original sqlite 3.1.3 on OS X

2008-09-09 Thread elizagu
Hi -- I wonder if anybody can help? I recently tried to update my copy of sqlite on my machine (running OS X 10.4) and stupidly overwrote my system's copy (i.e. I didn't use the /usr/local prefix). Now OS X 10.4 is fairly broken, and as far as I can ascertain it seems the default install of

[sqlite] Crashed on sqlite3_exec(pDb, "PRAGMA synchronous=OFF ", NULL, 0, );

2008-09-09 Thread Joanne Pham
Hi all, I had a function to open the database and set some database properties as below:  sqlite3_exec(pDb, "PRAGMA synchronous=OFF ", NULL, 0, ); and this function is crashed on some of the database but not all and return the message as below:     Program received signal SIGSEGV, Segmentation

Re: [sqlite] Bigger table and query optimization

2008-09-09 Thread Stephen Oberholtzer
On Tue, Sep 9, 2008 at 9:04 AM, Bruno Moreira Guedes <[EMAIL PROTECTED]>wrote: > 2008/9/9 P Kishor <[EMAIL PROTECTED]>: > > On 9/9/08, Bruno Moreira Guedes <[EMAIL PROTECTED]> wrote: > >> Hi people!! > >> > >> I'm getting problems with a bigger table. I'm doing a query like this: > >> > >>

Re: [sqlite] Bigger table and query optimization

2008-09-09 Thread Igor Tandetnik
"Stephen Oberholtzer" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > Idea: Submit a patch that allows LIKE expressions that start with a > fixed > string (i.e. don't start with '%') to use the index to improve > performance. (SQL Server 2000 does this.)