Re: [sqlite] Fortran 95 Language Bindings

2007-04-17 Thread Arjen Markus
Gary Scott wrote: Hi, CVF initially. I will likely transition to IVF once a suitable version is released. Well, that should be easy enough - MSVC/CVF is the platform I used to develop the interface. I managed to extend the documentation on the interface last night - see

[sqlite] SQLite Performance

2007-04-17 Thread Alberto Simões
Hi I've found SQLite faster than MySQL and Postgres for small/medium databases. Now I have big ones and I really do not want to change, but I have some performance issues. Consider the following database schema: CREATE TABLE tetragrams (word1 INTEGER, word2 INTEGER, word3 INTEGER, word4

Re: [sqlite] SQLite Performance

2007-04-17 Thread Dan Kennedy
On Tue, 2007-04-17 at 11:53 +0100, Alberto Simões wrote: > Hi > > I've found SQLite faster than MySQL and Postgres for small/medium > databases. Now I have big ones and I really do not want to change, but > I have some performance issues. > > Consider the following database schema: > CREATE

Re: [sqlite] Optimize a query

2007-04-17 Thread Martin Jenkins
Marco Bambini wrote: This query on a small database sometimes takes more than 40 seconds: select _rowid, public_id, vote_count, status, summary, component, date(date_modified), quickfix from reports where public = 1 AND _rowid IN (select distinct r._rowid from reports r, segments s where

Re: [sqlite] SQLite Performance

2007-04-17 Thread Alberto Simões
On 4/17/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: "=?ISO-8859-1?Q?Alberto_Sim=F5es?=" <[EMAIL PROTECTED]> wrote: > > Consider the following database schema: > CREATE TABLE tetragrams (word1 INTEGER, word2 INTEGER, word3 INTEGER, > word4 INTEGER, occs INTEGER, PRIMARY KEY (word1, word2,

[sqlite] Insert order maintained?

2007-04-17 Thread Alberto Simões
Hi I would like to know if the order I get the rows from a select (without ORDER BY) is the order by which the values were inserted. I know this is the behavior for MySQL, but not sure about SQLite. THank you Alberto -- Alberto Simões

Re: [sqlite] Insert order maintained?

2007-04-17 Thread Scott Hess
Additionally, note that if you use ORDER BY, and it _is_ in the indicated order already, then sqlite will optimize the ORDER BY away entirely. So use ORDER BY. -scott On 4/17/07, Andrew Finkenstadt <[EMAIL PROTECTED]> wrote: The order of the rows returned by a select that does not have an

RE: [sqlite] Insert order maintained?

2007-04-17 Thread Samuel R. Neff
We got bit by this when moving from MSSQL 2000 to MSSQL 2005. MSSQL returned rows by default in PK order and one of our former developers depended on this so when the behavior changed in MSSQL 2005 (which is fine 'cause it wasn't documented or expected behavior) our app broke in unexpected ways.

Re: [sqlite] Insert order maintained?

2007-04-17 Thread BardzoTajneKonto
> I know this is the behavior for MySQL, but not sure about SQLite. I'v heard about some version of mysql that didn't return rows in the same order (but haven't seen it myselt). So unless this behaviour is documented in mysql manual, it's not a good idea to rely on this. Actually I'v seen

Re: [sqlite] Optimize a query

2007-04-17 Thread Martin Pelletier
This is news to me. Why can't SQlite use more than one index? Samuel R. Neff wrote: afaik SQLite will only use one index per table -- Martin Pelletier Informatique / Software Development Infodev Electronic Designers International Inc. Tel : +1 (418) 681-3539, poste /ext. 114 Fax : +1 (418)

Re: [sqlite] Optimize a query

2007-04-17 Thread Paul Smith
At 16:46 17/04/2007, you wrote: This is news to me. Why can't SQlite use more than one index? Possibly because it's 'SQ *Lite*'? The query optimiser in SQLite is a lot less powerful than in some other SQL databases - but then it's a fraction of the size as well... Instead of having two

Re: [sqlite] Is this a valid syntax

2007-04-17 Thread Paul Smith
At 16:45 17/04/2007, Stef Mientki wrote: I don't understand this behaviour, is this too complex ? or am I doing something wrong ? I use the following syntax, and I get 7 records back, (which is not correct in my opinion) SELECT PO.* FROM Koppel LEFT JOIN PO WHERE (Koppel.K_App == PO.App)

[sqlite] Is this a valid syntax

2007-04-17 Thread Stef Mientki
I don't understand this behaviour, is this too complex ? or am I doing something wrong ? I use the following syntax, and I get 7 records back, (which is not correct in my opinion) SELECT PO.* FROM Koppel LEFT JOIN PO WHERE (Koppel.K_App == PO.App) AND (Koppel.K_naam == 'MVE')

[sqlite] Re: Is this a valid syntax

2007-04-17 Thread Igor Tandetnik
Stef Mientki <[EMAIL PROTECTED]> wrote: I use the following syntax, and I get 7 records back, (which is not correct in my opinion) SELECT PO.* FROM Koppel LEFT JOIN PO WHERE (Koppel.K_App == PO.App) AND (Koppel.K_naam == 'MVE') AND (PO.ALL_answered == '0') If I leave the

Re: [sqlite] Optimize a query

2007-04-17 Thread drh
Martin Pelletier <[EMAIL PROTECTED]> wrote: > This is news to me. Why can't SQlite use more than one index? > It can. You just have to tell it to explicitly by restructuring your SQL. As an example, consider this query: SELECT * FROM table1 WHERE a=5 AND b=11; Suppose there are two

Re: [sqlite] Insert order maintained?

2007-04-17 Thread Andrew Finkenstadt
The order of the rows returned by a select that does not have an ORDER BY clause is guaranteed by the standard to be in any arbitrary order, even from one execution to another due to changes in the underlying data, index statistics, amount of memory available, or even the phase of the moon. Use

[sqlite] Optimize a query

2007-04-17 Thread Marco Bambini
This query on a small database sometimes takes more than 40 seconds: select _rowid, public_id, vote_count, status, summary, component, date (date_modified), quickfix from reports where public = 1 AND _rowid IN (select distinct r._rowid from reports r, segments s where s.report_id = r._rowid

RE: [sqlite] Optimize a query

2007-04-17 Thread Samuel R. Neff
afaik SQLite will only use one index per table so if you have a where clause "WHERE public = 1 and _rowid IN (...)" it will use an index on public and not _rowid. Swapping the where clause around should have a significant impact: select _rowid, public_id, vote_count,

Re: [sqlite] Optimize a query

2007-04-17 Thread bartsmissaert
Interesting and thanks for that tip. Is there a performance penalty from structuring the query like that? I take it that there will be. RBS > Martin Pelletier <[EMAIL PROTECTED]> wrote: >> This is news to me. Why can't SQlite use more than one index? >> > > It can. You just have to tell it to

Re: [sqlite] SQLite Performance

2007-04-17 Thread drh
"=?ISO-8859-1?Q?Alberto_Sim=F5es?=" <[EMAIL PROTECTED]> wrote: > > Consider the following database schema: > CREATE TABLE tetragrams (word1 INTEGER, word2 INTEGER, word3 INTEGER, > word4 INTEGER, occs INTEGER, PRIMARY KEY (word1, word2, word3, > word4)); > CREATE INDEX tet_b ON tetragrams

Re: [sqlite] Still getting "Insertion failed because database is full." errors

2007-04-17 Thread Joel Cochran
The saga continues... I was very excited by the idea that there was something wrong with the CF Card. The theory fits all the facts: it explains why the original database threw unspecified errors, it explains why now SQLite is throwing errors, it explains why I can't reproduce the problem in

[sqlite] what do I compile with -dthreadsafe=1

2007-04-17 Thread Rafi Cohen
Hi, when I read the article about sqlite and multithread in cvstrac, I understood that I need to compile my source files using sqlite functions with -DTHREADSAFE=1. Now, due to a pproblem I had in my project I re-readad this article and began to think I should compile sqlite source files using

Re: [sqlite] Still getting "Insertion failed because database is full." errors

2007-04-17 Thread Jonas Sandman
What is the guy on in the field doing that you are not? Are you using his device for the testing? Since it takes minutes for him to encounter the error it can't be that hard to recreate. Follow him around for an hour or so and see how he uses the program. It could easily be something he's doing

Re: [sqlite] Insert order maintained?

2007-04-17 Thread Alberto Simões
Ok, I'll use ORDER BY. Thanks! Alberto On 4/17/07, Samuel R. Neff <[EMAIL PROTECTED]> wrote: We got bit by this when moving from MSSQL 2000 to MSSQL 2005. MSSQL returned rows by default in PK order and one of our former developers depended on this so when the behavior changed in MSSQL 2005

Re: [sqlite] Is this a valid syntax

2007-04-17 Thread Stef Mientki
I don't know if this is the problem, but, for some reason you're mixing C/C++ syntax in with SQL there. You don't use '==', you should just use '=' You don't use '!=', you should use '<>' thanks Paul, but although I can never find this information when I need it :-( AFAIK, both

Re: [sqlite] Re: Is this a valid syntax

2007-04-17 Thread Stef Mientki
Igor Tandetnik wrote: Stef Mientki <[EMAIL PROTECTED]> wrote: I use the following syntax, and I get 7 records back, (which is not correct in my opinion) SELECT PO.* FROM Koppel LEFT JOIN PO WHERE (Koppel.K_App == PO.App) AND (Koppel.K_naam == 'MVE') AND (PO.ALL_answered

Re: [sqlite] Still getting "Insertion failed because database is full." errors

2007-04-17 Thread John Stanton
Perhaps you need to design an experiment to detect the problem. Part of it might be to log activity. Relying on a debugger rather than logical analysis can waste a lot of time. Joel Cochran wrote: I've had him sit beside my in my office and attempt to recreate it, both using his device and

[sqlite] PRAGMA short_column_names ignored when GROUP BY is used

2007-04-17 Thread Samuel R. Neff
It looks like short_column_names pragma is ignored when GROUP BY is used in a query. Is this considered expected behavior? I hope not.. :-) Thanks, Sam sqlite> pragma short_column_names; short_column_names -- 1 sqlite> pragma full_column_names; full_column_names

Re: [sqlite] Still getting "Insertion failed because database is full." errors

2007-04-17 Thread Jonas Sandman
Either add a trace-log which shows the flow of the program (entering, exiting methods, database commands accessed). It's not so simple that when you send the program to him in the field, it's a release build and when you test you are using a debug build? On 4/17/07, Joel Cochran <[EMAIL

AW: [sqlite] Still getting "Insertion failed because database is full." errors

2007-04-17 Thread Michael Ruck
Unfortunately DEBUG builds change timing entirely on windows platforms. I would suggest creating a release build with symbols. Mike -Ursprüngliche Nachricht- Von: Joel Cochran [mailto:[EMAIL PROTECTED] Gesendet: Dienstag, 17. April 2007 20:59 An: sqlite-users@sqlite.org Betreff: Re:

Re: [sqlite] Is this a valid syntax

2007-04-17 Thread Dennis Cote
Stef Mientki wrote: I don't know if this is the problem, but, for some reason you're mixing C/C++ syntax in with SQL there. You don't use '==', you should just use '=' You don't use '!=', you should use '<>' thanks Paul, but although I can never find this information when I need it :-(

Re: [sqlite] what do I compile with -dthreadsafe=1

2007-04-17 Thread Ken
configure --enable-threadsafe should do it. Rafi Cohen <[EMAIL PROTECTED]> wrote: Hi, when I read the article about sqlite and multithread in cvstrac, I understood that I need to compile my source files using sqlite functions with -DTHREADSAFE=1. Now, due to a pproblem I had in my project I

Re: [sqlite] Is this a valid syntax

2007-04-17 Thread Stef Mientki
Dennis Cote wrote: Stef Mientki wrote: I don't know if this is the problem, but, for some reason you're mixing C/C++ syntax in with SQL there. You don't use '==', you should just use '=' You don't use '!=', you should use '<>' thanks Paul, but although I can never find this

Re: [sqlite] Is this a valid syntax

2007-04-17 Thread Dennis Cote
Stef Mientki wrote: But it doesn't solve my problem :-( I've the feeling that despite the suggestions of Igor, the problem still exists, caused by the zero values ?? I'll try tomorrow again with some other values. Stef, Oh... I though Igor had solved your problem so I didn't give it much

Re: [sqlite] Is this a valid syntax

2007-04-17 Thread Stef Mientki
Dennis Cote wrote: Stef Mientki wrote: But it doesn't solve my problem :-( I've the feeling that despite the suggestions of Igor, the problem still exists, caused by the zero values ?? I'll try tomorrow again with some other values. Stef, Oh... I though Igor had solved your problem so I

Re: [sqlite] Is this a valid syntax

2007-04-17 Thread drh
Dennis Cote <[EMAIL PROTECTED]> wrote: > > Being a C programmer, Richard extended SQLite to allow C syntax for > equality and inequality comparisons as shown at > http://www.sqlite.org/lang_expr.html even though it is non standard. Actually, the reason I did this was because PostgreSQL did it

Re: [sqlite] Still getting "Insertion failed because database is full." errors

2007-04-17 Thread Dan Kennedy
> At first I thought this had solved the problem, because all in house testing > runs beautifully. However, as soon as the device is sent to the field, the > error starts again. Unfortunately, it means that I have never been able to > catch this in debug. I did, however, change the error