Re: [sqlite] 2.8.17 --> 3.5.6 performance regression

2008-03-28 Thread Mike Owens
I would guess PRAGMA synchronous. Per documentation: "In SQLite version 2, the default value is NORMAL. For version 3, the default was changed to FULL." Try setting it to NORMAL for v3 tests and see what that does. -- Mike On Thu, Mar 27, 2008 at 11:06 PM, Richard Klein <[EMAIL PROTECTED]>

[sqlite] Faulty "date" function

2008-03-28 Thread Zbigniew Baniewski
#v+ SQLite version 3.5.6 Enter ".help" for instructions sqlite> select date('now'); 2008-03-28 sqlite> select date('now')-14; 1994 sqlite> #v- Of course, proper answer should be: "2008-03-14" - shouldn't it? -- pozdrawiam / regards

Re: [sqlite] Faulty "date" function

2008-03-28 Thread Scott Baker
Zbigniew Baniewski wrote: > #v+ > SQLite version 3.5.6 > Enter ".help" for instructions > sqlite> select date('now'); > 2008-03-28 > sqlite> select date('now')-14; > 1994 > sqlite> No I think it's doing exactly what it should. You're asking a very vague question. My guess is SQLite returns

Re: [sqlite] Faulty "date" function

2008-03-28 Thread Scott Baker
Zbigniew Baniewski wrote: > #v+ > SQLite version 3.5.6 > Enter ".help" for instructions > sqlite> select date('now'); > 2008-03-28 > sqlite> select date('now')-14; > 1994 > sqlite> I think what you want is date math: sqlite> SELECT date('now','-14 days'); 2008-03-14 All well documented on the

Re: [sqlite] Faulty "date" function

2008-03-28 Thread Igor Tandetnik
Zbigniew Baniewski <[EMAIL PROTECTED]> wrote: > #v+ > SQLite version 3.5.6 > Enter ".help" for instructions > sqlite> select date('now'); > 2008-03-28 > sqlite> select date('now')-14; > 1994 date() function produces a string. You are trying to subtract a number from a string, at which point

Re: [sqlite] Faulty "date" function

2008-03-28 Thread Zbigniew Baniewski
On Fri, Mar 28, 2008 at 11:37:10AM -0700, Scott Baker wrote: > I think what you want is date math: > > sqlite> SELECT date('now','-14 days'); > 2008-03-14 Yes, I wanted date 2 weeks ago. I made a comparison using PostgreSQL, where it returns the expected date value, and my guess was, that it

Re: [sqlite] Conversion string -> date

2008-03-28 Thread Zbigniew Baniewski
On Fri, Mar 28, 2008 at 02:39:23PM -0400, Igor Tandetnik wrote: > date() function produces a string. You are trying to subtract a number > from a string, at which point SQLite converts the string to number > ('2008-03-28' becomes 2008) and performs the subtraction (2008 - 14 == > 1994). I

Re: [sqlite] Conversion string -> date

2008-03-28 Thread Igor Tandetnik
Zbigniew Baniewski <[EMAIL PROTECTED]> wrote: > On Fri, Mar 28, 2008 at 02:39:23PM -0400, Igor Tandetnik wrote: > >> date() function produces a string. You are trying to subtract a >> number from a string, at which point SQLite converts the string to >> number ('2008-03-28' becomes 2008) and

[sqlite] SQLite with PHP and Apache C Module

2008-03-28 Thread Sam Carleton
My web application is a mix of PHP code and an Apache C Module. Both access the same SQLite3 database. Because of this, I am using the shared version of the PHP SQLite library and the Apache C module is dynamically linking, as well. The Apache C module only connects to the database during an

Re: [sqlite] SQLITE_MEMORY_SIZE=nnn

2008-03-28 Thread Richard Klein
I think I found the answer to my own question: (1) Pick an arbtrary, huge initial value for nnn in the compilation option SQLITE_MEMORY_SIZE=nnn; (2) Let my app run for awhile; (3) Call sqlite_memory_highwater() to find out the maximum amount of memory that has ever been allocated (i.e. the

[sqlite] TCL & tester.tcl question

2008-03-28 Thread Noah Hart
A general question for the TCL experts There is no problem, I'm just trying to understand how TCL works. In tester.tcl,v 1.79, at line 60, there is the following section: # Create a test database # catch {db close} file delete -force test.db file delete -force test.db-journal sqlite3 db

Re: [sqlite] TCL & tester.tcl question

2008-03-28 Thread Zbigniew Baniewski
On Fri, Mar 28, 2008 at 01:35:01PM -0700, Noah Hart wrote: I'm not an expert (yet... ;) - but I'm doing some TCL. > sqlite3 db ./test.db > set ::DB [sqlite3_connection_pointer db] > > My question is: Why is the last line not "set ::DB db" It seems, that there's an attempt to assign to global

Re: [sqlite] TCL & tester.tcl question

2008-03-28 Thread D. Richard Hipp
On Mar 28, 2008, at 4:35 PM, Noah Hart wrote: > A general question for the TCL experts > > There is no problem, I'm just trying to understand how TCL works. > > In tester.tcl,v 1.79, at line 60, there is the following section: > > # Create a test database > # > catch {db close} > file delete

[sqlite] "Unsupported File Format" from 3.1.3

2008-03-28 Thread Jerry Krinock
Someone sent me an sqlite database file. Opening in Mac OS 10.5 with the built-in sqlite 3.4.0, no problems. Opening in Mac OS 10.4 with the built-in sqlite 3.1.3, any query returns sqlite error 1, "unsupported file format". Similar files from other users open in either Mac OS/sqlite version.

[sqlite] Go to specific row in database

2008-03-28 Thread flakpit
MySql and msSql have seek commands to go to a( or return) a specific row in a database base don the internal row number rather than an id or other identifier. Is there a generic SELECT statement that can do this for sqlite or indeed, any other sql variant? Regards. -- View this message in