Re: [sqlite] Slow SQL statements

2005-05-22 Thread Ludvig Strigeus
Why doesn't SQL provide a utility function: maxv Then you could (almost) write it like this: SELECT maxv(sb, playerid) FROM batting WHERE playerid IN (SELECT player FROM fielding WHERE pos='3B' AND lgid='NL')); The semantics of maxv(arg, value) would be that it finds the maximum of arg, bu

Re: [sqlite] Slow SQL statements

2005-05-22 Thread D. Richard Hipp
On Sun, 2005-05-22 at 22:02 -0400, D. Richard Hipp wrote: > On Sun, 2005-05-22 at 19:42 -0400, Al Danial wrote: > > > > sqlite baseball.db 'select playerid,sb from batting where sb = (select > > max(sb) from batting where playerid in (select playerid from fielding > > where pos = "3B" and lgid = "

Re: [sqlite] Slow SQL statements

2005-05-22 Thread D. Richard Hipp
On Sun, 2005-05-22 at 19:42 -0400, Al Danial wrote: > then try queries such as > > sqlite baseball.db 'select playerid,sb from batting where sb = (select > max(sb) from batting where playerid in (select playerid from fielding > where pos = "3B" and lgid = "NL"));' > > which tries to answer the qu

Re: [sqlite] Transaction for single SQL query?

2005-05-22 Thread Cory Nelson
no, as all queries that aren't in a transaction act as a single transaction themselves. On 5/22/05, Brown, Dave <[EMAIL PROTECTED]> wrote: > > Is there any benefit in a C program to wrapping a single insert via > sqlite3_exec() in a transaction? > In other words, is > > INSERT INTO table1 VALUES

Re: [sqlite] How to lock my database?

2005-05-22 Thread Cory Nelson
http://www.sqlite.org/lang_transaction.html On 5/22/05, liigo <[EMAIL PROTECTED]> wrote: > How to lock my database? > > Thanks for help! > > -- Cory Nelson http://www.int64.org

[sqlite] Transaction for single SQL query?

2005-05-22 Thread Brown, Dave
Is there any benefit in a C program to wrapping a single insert via sqlite3_exec() in a transaction? In other words, is INSERT INTO table1 VALUES(1,2); any worse (or better) than doing: BEGIN; INSERT INTO table1 VALUES(1,2); COMMIT; Thanks, Dave

[sqlite] How to lock my database?

2005-05-22 Thread liigo
How to lock my database? Thanks for help!

Re: [sqlite] Slow SQL statements

2005-05-22 Thread Al Danial
I created an SQLite database of baseball stats (based on data pulled from http://baseball1.info/) to show off SQLite at a presentation yesterday. There's enough data (over 340,000 total rows in 21 tables) to make for some pretty slow queries. Download the SQL statements and set up the database

Re: [sqlite] Behavior on corrupt database

2005-05-22 Thread D. Richard Hipp
On Sun, 2005-05-22 at 21:12 +0200, Ludvig Strigeus wrote: > If I corrupt my database in certain ways, I can make Sqlite crash. Is > this by design, or is it a bug? > This is a bug, though not a high-priority one. -- D. Richard Hipp <[EMAIL PROTECTED]>

[sqlite] Behavior on corrupt database

2005-05-22 Thread Ludvig Strigeus
If I corrupt my database in certain ways, I can make Sqlite crash. Is this by design, or is it a bug? /Ludvig

Re: [sqlite] unit tests

2005-05-22 Thread D. Richard Hipp
On Sun, 2005-05-22 at 20:35 +0200, Ludvig Strigeus wrote: > How do I run the unit tests in Linux? > > I've managed to build "tclsqlite3", but where do I go from there? > make testfixture ./testfixture ../sqlite/test/all.test Or simply make fulltest -- D. Richard Hipp <[EMAIL PROTECT

Re: [sqlite] unit tests

2005-05-22 Thread G. Roderick Singleton
On Sun, 2005-05-22 at 14:01 -0500, Kurt Welgehausen wrote: > > How do I run the unit tests in Linux? > > make test Running make test as root can give odd results. Use a user account. -- G. Roderick Singleton <[EMAIL PROTECTED]> PATH tech

Re: [sqlite] unit tests

2005-05-22 Thread Kurt Welgehausen
> How do I run the unit tests in Linux? make test

[sqlite] unit tests

2005-05-22 Thread Ludvig Strigeus
How do I run the unit tests in Linux? I've managed to build "tclsqlite3", but where do I go from there? /Ludvig

[sqlite] Slow SQL statements

2005-05-22 Thread Ludvig Strigeus
Hello, Can someone come up with some slow SQL statements (that execute in like 2 seconds) that are not disk bound but CPU bound. Preferably single liners. I'm playing around with a profiler and trying to find bottlenecks in sqlite and optimizing them. /Ludvig

Re: [sqlite] What does this code do?

2005-05-22 Thread D. Richard Hipp
On Sun, 2005-05-22 at 10:19 +0200, Ludvig Strigeus wrote: > Why not pass a single number to sqlite3VdbeRecordCompare instead, that > just says how many fields to compare? That seems simpler. Why was the > current design chosen. > The reason for not passing in a nField value is that the BTree layer

Re: [sqlite] What does this code do?

2005-05-22 Thread Ludvig Strigeus
What if the last field of record1 is a NULL, and the last field of record2 is an empty string. Then there's no way to tell sqlite3VdbeRecordCompare that you don't want to compare those items. If you set nKey1 and nKey2 to the last offsets of each record, the last items will be compared too. Why n