Re: [sqlite] Huge performance drop when using prepared statement

2007-12-10 Thread Markus Gritsch
On 10/12/2007, Ed Pasma <[EMAIL PROTECTED]> wrote: > Hello, think I got it, but it is disappointingly simple, see below. Ed. > > Markus Gritsch wrote: > > > Even more strange: > > > > c.execute("""SELECT * FROM entry, word, word_entry WHERE > > entry.id = word_entry.entry_id AND > > word.id =

Re: [sqlite] Problem using mem1.c/mem3.c with v3.5.3

2007-12-10 Thread Teg
Hello Jang, Monday, December 10, 2007, 1:39:02 AM, you wrote: JJ> Hello, JJ> JJ> Now I'm using SQLite v3.4.2 in my Mobile Device(ARM9-200Mhz, 8MB SRAM) JJ> and it works fine. JJ> JJ> But when I updated to SQLitev3.5.3 this time I am facing problem. JJ> JJ> Please let me know why it

[sqlite] Performance issue

2007-12-10 Thread Stergios Zissakis
Hello to everyone, This is my first post in the list I've got the following 3 tables: CREATE TABLE A ( int1 INTEGER, txt1 TEXT, int2 INTEGER, txt2 TEXT, PRIMARY KEY ( txt1 ) ); CREATE TABLE B ( txt1 TEXT, int1 INTEGER ); CREATE TABLE C ( txt1 TEXT, int1 INTEGER ); Each table

[sqlite] Explicitly managing multiple SQLite databases.....

2007-12-10 Thread Yuvaraj Athur Raghuvir
Hello, I am trying a simple experiment where I want to limit the size of the file that SQLite uses. Further, I want to manage the growth of the database(s) explicitly. One of the first aspects I want to manage is the size of the file on the disk. I want to set hard limits on the size and during

[sqlite] Simple question about optimization

2007-12-10 Thread Clodo
In this case: - CREATE TABLE test ( Field01 text PRIMARY KEY NOT NULL, Field02 text ); insert into test values ('alpha','beta'); update test set Field01='alpha', Field02='gamma'; - In the "update" statement, i re-set the primary field

Re: [sqlite] [Linux + PHP] Recommended way to access SQLite?

2007-12-10 Thread Chris Peachment
According to the php info() function, on Ubuntu, PHP Version 5.2.3-1ubuntu6.2 was released on 3 December 2007 and includes the PDO sqlite driver for sqlite version 3.5.2. It also includes the extension library sqlite driver for version 2.8.17 so you have your choice there. Personally, I use PDO

[sqlite] Re: Simple question about optimization

2007-12-10 Thread Igor Tandetnik
Clodo <[EMAIL PROTECTED]> wrote: - CREATE TABLE test ( Field01 text PRIMARY KEY NOT NULL, Field02 text ); insert into test values ('alpha','beta'); update test set Field01='alpha', Field02='gamma'; - In the "update" statement, i re-set the

Re: [sqlite] Simple question about optimization

2007-12-10 Thread Kees Nuyt
On Mon, 10 Dec 2007 12:22:53 +0100, Clodo <[EMAIL PROTECTED]> wrote: >In this case: > >- >CREATE TABLE test ( > Field01 text PRIMARY KEY NOT NULL, > Field02 text >); > >insert into test values ('alpha','beta'); > >update test set Field01='alpha', Field02='gamma';

Re: [sqlite] PATCH: compound query column naming and resolving (Ticket #2822)

2007-12-10 Thread Dennis Cote
[EMAIL PROTECTED] wrote: Can you please tell me what other databases do with this: CREATE TABLE t1(a,b,c); INSERT INTO t1 VALUES(1,2,4); SELECT a+b AS c FROM t1 WHERE c==4; In the WHERE clause, should the "c" resolve to the column "c" or to the "a+b" expression? I'm guessing the

Re: [sqlite] [Linux + PHP] Recommended way to access SQLite?

2007-12-10 Thread Kees Nuyt
On Mon, 10 Dec 2007 08:36:54 -0400, Chris Peachment <[EMAIL PROTECTED]> wrote: > According to the php info() function, on Ubuntu, PHP Version > 5.2.3-1ubuntu6.2 was released on 3 December 2007 and includes the > PDO sqlite driver for sqlite version 3.5.2. > > It also includes the extension

Re: [sqlite] PATCH: compound query column naming and resolving (Ticket #2822)

2007-12-10 Thread drh
Dennis Cote <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > > > Can you please tell me what > > other databases do with this: > > > >CREATE TABLE t1(a,b,c); > >INSERT INTO t1 VALUES(1,2,4); > >SELECT a+b AS c FROM t1 WHERE c==4; > > > > In the WHERE clause, should the "c"

Re: [sqlite] Is there a way to do comparison of text in a numerical way.

2007-12-10 Thread Dennis Cote
Mag. Wilhelm Braun wrote: I thought that this might properly a bigger thing. Well, I found a solution which fits my purpose at the moment. ( SELECT txt FROM test WHERE txt=(SELECT max(CAST(txt AS REAL)) from test) ) I do not use selection of max() or min() very often - it seems it is the

Re: [sqlite] Performance issue

2007-12-10 Thread Dennis Cote
Stergios Zissakis wrote: My question is: shouldn't sqlite's engine figure out what I am trying to do and sort the tables on the fly in an effort to optimize the query? When using no indexes, a .explain reveals 3 nested loops which take a long time to return results. Any help/ideas will be

Re: [sqlite] PATCH: compound query column naming and resolving (Ticket #2822)

2007-12-10 Thread Joe Wilson
--- [EMAIL PROTECTED] wrote: > Dennis Cote <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] wrote: > > > > > > Can you please tell me what > > > other databases do with this: > > > > > >CREATE TABLE t1(a,b,c); > > >INSERT INTO t1 VALUES(1,2,4); > > >SELECT a+b AS c FROM t1 WHERE c==4;

Re: [sqlite] Simple question about optimization

2007-12-10 Thread Cesar D. Rodas
What Kess Nuyt is asking is if you want to replace a column with a data, which is the data, will SQLite update it or SQLite is smart enough for avoid write the same thing?, very important for keep executing time, because write something to HDD is very expensive. I hope I understand well your

Re: [sqlite] Simple question about optimization

2007-12-10 Thread Cesar D. Rodas
On 10/12/2007, Cesar D. Rodas <[EMAIL PROTECTED]> wrote: > > What Kess Nuyt is asking is if you want to replace a column with a data, > which is the data, will SQLite update it or SQLite is smart enough for > avoid write the same thing?, very important for keep executing time, > because write

Re: [sqlite] Is there a way to do comparison of text in a numerical way.

2007-12-10 Thread Mag. Wilhelm Braun
Thanks for the hint. W.Braun Dennis Cote wrote: Mag. Wilhelm Braun wrote: I thought that this might properly a bigger thing. Well, I found a solution which fits my purpose at the moment. ( SELECT txt FROM test WHERE txt=(SELECT max(CAST(txt AS REAL)) from test) ) I do not use selection of

Re: [sqlite] Problem installing TCL bindings

2007-12-10 Thread drh
[EMAIL PROTECTED] wrote: > Zbigniew Baniewski <[EMAIL PROTECTED]> wrote: > > On Sat, Dec 08, 2007 at 08:14:41PM +0530, yahalome wrote: > > > > > Just mkdir /usr/share/tcl8.4/sqlite3 [..] > > > > Perhaps it'll be not enough, when he got such error message: > > > > > symbol: sqlite3StrICmp > >

Re: [sqlite] search time in FTS3 tables sometimes very long

2007-12-10 Thread Scott Hess
BTW, http://www.sqlite.org/cvstrac/chngview?cn=4599 is the final fix to this. It's different from the patch I posted. The patch did the job, but felt wrong to me. This has the same performance characteristics, but feels ... well, less wrong. This change should apply cleanly to fts2.c, if

Re: [sqlite] Simple question about optimization

2007-12-10 Thread Dan
On 10/12/2007, Kees Nuyt <[EMAIL PROTECTED]> wrote: On Mon, 10 Dec 2007 12:22:53 +0100, Clodo <[EMAIL PROTECTED]> wrote: In this case: - CREATE TABLE test ( Field01 text PRIMARY KEY NOT NULL, Field02 text ); insert into test values ('alpha','beta'); update test

[sqlite] SQLite News

2007-12-10 Thread Jonathan O
http://sqlite.org/news.html has a bad link to http://sqlite.org/download, instead it should be http://sqlite.org/download.html. The link is under 3.5.3 news second paragraph first sentence called download.html. Jonathan

[sqlite] Re: SQLite News

2007-12-10 Thread Jonathan O
On 12/10/07, Jonathan O <[EMAIL PROTECTED]> wrote: > > http://sqlite.org/news.html has a bad link to http://sqlite.org/download, > instead it should be http://sqlite.org/download.html . The link is under > 3.5.3 news second paragraph first sentence called download.html. > I had trouble trying to

[sqlite] Can someone explain this error....

2007-12-10 Thread Tom Shaw
I periodically get the following error: Error!: SQLSTATE[HY000]: General error: 17 database schema has changed However all I am doing is selecting, inserting and updating. How can those functions change the schema? TIA Tom

Re: [sqlite] Can someone explain this error....

2007-12-10 Thread Jonathan O
On 12/10/07, Tom Shaw <[EMAIL PROTECTED]> wrote: > > I periodically get the following error: > > Error!: SQLSTATE[HY000]: General error: 17 database schema has changed > > However all I am doing is selecting, inserting and updating. How can > those functions change the schema? > Just a guess but

Re: [sqlite] Simple question about optimization

2007-12-10 Thread Clodo
Thanks Dan, your answer it's exactly what i want to know. Thanks again! On 10/12/2007, Kees Nuyt <[EMAIL PROTECTED]> wrote: On Mon, 10 Dec 2007 12:22:53 +0100, Clodo <[EMAIL PROTECTED]> wrote: In this case: - CREATE TABLE test ( Field01 text PRIMARY KEY NOT NULL,

[sqlite] Regarding explicitly managing SQLite Databases....[Resend]

2007-12-10 Thread Yuvaraj Athur Raghuvir
Hello, I am trying a simple experiment where I want to limit the size of the file that SQLite uses. Further, I want to manage the growth of the database(s) explicitly. One of the first aspects I want to manage is the size of the file on the disk. I want to set hard limits on the size and during

[sqlite] Seg fault after calling sqlite3_exec while running under cygwin

2007-12-10 Thread John Williams
I'm new to using sqlite, so I'm writing a rather simple piece of software for a friend that I would normally just use my own file stucture...but being that I want to learn about sqlite here I am. I should note that since the and program is destined for windows computers I'm doing my development

Re: [sqlite] Seg fault after calling sqlite3_exec while running under cygwin

2007-12-10 Thread James Steward
On Mon, 2007-12-10 at 20:37 -0700, John Williams wrote: > Since I'm not really sure where the problem is I've attached a zip of my c > files. AptAssist.c is my main file and contains the full program. > Temp.cis a simple pull out of the problem function. I didn't get an attachment. Did anyone?

Re: [sqlite] Regarding explicitly managing SQLite Databases....[Resend]

2007-12-10 Thread Dan
On Dec 11, 2007, at 8:39 AM, Yuvaraj Athur Raghuvir wrote: Hello, I am trying a simple experiment where I want to limit the size of the file that SQLite uses. Further, I want to manage the growth of the database(s) explicitly. One of the first aspects I want to manage is the size of the

Re: [sqlite] Seg fault after calling sqlite3_exec while running under cygwin

2007-12-10 Thread Dan
On Dec 11, 2007, at 10:37 AM, John Williams wrote: I'm new to using sqlite, so I'm writing a rather simple piece of software for a friend that I would normally just use my own file stucture...but being that I want to learn about sqlite here I am. I should note that since the and program

Re: [sqlite] PATCH: compound query column naming and resolving (Ticket #2822)

2007-12-10 Thread Robert Wishlaw
On 12/8/07, Joe Wilson <[EMAIL PROTECTED]> wrote: > --- Robert Wishlaw <[EMAIL PROTECTED]> wrote: > > > >CREATE TABLE t1(a,b,c); > > > IBM DB2 9.5 > > > > INSERT INTO t1 VALUES(1,2,4); > > SELECT a+b AS c FROM t1 WHERE c=4; > > > > returns > > > > C > > > >

Re: [sqlite] PATCH: compound query column naming and resolving (Ticket #2822)

2007-12-10 Thread Robert Wishlaw
On 12/10/07, Joe Wilson <[EMAIL PROTECTED]> wrote: > --- [EMAIL PROTECTED] wrote: > > Dennis Cote <[EMAIL PROTECTED]> wrote: > > > [EMAIL PROTECTED] wrote: > > > > > > > > Can you please tell me what > > > > other databases do with this: > > > > > > > >CREATE TABLE t1(a,b,c); > > > >INSERT

[sqlite] http://www.sqlite.org/

2007-12-10 Thread Ion Silvestru
I am not well versed in english, but this phrase from home page: "This the homepage for SQLite - ...", I think must be rephrased: "This is the homepage for SQLite - ...". Anyway, many thanks for SQLite and its community.

Re: [sqlite] PATCH: compound query column naming and resolving (Ticket #2822)

2007-12-10 Thread Trevor Talbot
On 12/10/07, Robert Wishlaw <[EMAIL PROTECTED]> wrote: > IBM DB2 9.5 > > select a AS "foo" from t1 union select b from t1 order by foo > SQL0206N "FOO" is not valid in the context where it is used. SQLSTATE=42703 The problem here is with the inconsistent quoting. PostgreSQL uses the opposite

Re: [sqlite] how to cast utf16 text to int?

2007-12-10 Thread Trevor Talbot
On 12/5/07, Maxim V. Shiyanovsky <[EMAIL PROTECTED]> wrote: > I have table that holds values of different types in utf16. > I also know value type for the current row. > How should I cast value to compare it with integer? > > This test shows 1 instead of 17 that I expected. > > sqlite> create