Re: [sqlite] An interesting (strange) issue with selects

2012-06-23 Thread Pavel Ivanov
On Sat, Jun 23, 2012 at 10:36 PM, Dennis Volodomanov wrote: > On 24/06/2012 12:29 PM, Pavel Ivanov wrote: >> >> AFAIK, checkpoints are application-specific, but SQLite prohibits >> second writer until first one committed its transaction and released >> database lock. So there

Re: [sqlite] An interesting (strange) issue with selects

2012-06-23 Thread Dennis Volodomanov
On 24/06/2012 12:55 PM, Simon Slavin wrote: Depending on the order and timing of how the two threads/processes run, something will eventually happen to your second writer. It will probably reach whatever timeout you've set (which defaults to zero) and then return a result code indicating

Re: [sqlite] An interesting (strange) issue with selects

2012-06-23 Thread Simon Slavin
On 24 Jun 2012, at 3:36am, Dennis Volodomanov wrote: > On 24/06/2012 12:29 PM, Pavel Ivanov wrote: >> AFAIK, checkpoints are application-specific, but SQLite prohibits >> second writer until first one committed its transaction and released >> database lock. So there can't be

Re: [sqlite] An interesting (strange) issue with selects

2012-06-23 Thread Dennis Volodomanov
On 24/06/2012 12:29 PM, Pavel Ivanov wrote: AFAIK, checkpoints are application-specific, but SQLite prohibits second writer until first one committed its transaction and released database lock. So there can't be such thing as "two writers, both writing to the same DB". If one writer writes,

Re: [sqlite] An interesting (strange) issue with selects

2012-06-23 Thread Pavel Ivanov
On Sat, Jun 23, 2012 at 10:18 PM, Dennis Volodomanov wrote: > It does raise an interesting question though - how is this handled in SQLite > internally? When there are two writers, both writing to the same DB (WAL > mode) and one of them crashes before reaching a checkpoint,

Re: [sqlite] An interesting (strange) issue with selects

2012-06-23 Thread Dennis Volodomanov
On 24/06/2012 11:38 AM, Pavel Ivanov wrote: Such thing shouldn't ever happen, otherwise SQLite has a serious bug. Pavel It could be just my code of course. I guess I need to write a simple console app that simulates this to see if this guess is valid or not in the first place. It does

Re: [sqlite] An interesting (strange) issue with selects

2012-06-23 Thread Pavel Ivanov
On Sat, Jun 23, 2012 at 9:21 PM, Dennis Volodomanov wrote: > On 22/06/2012 9:48 AM, Dennis Volodomanov wrote: >> >> I'll see if the new compilation options still make this happen, but it >> takes a couple of hours for each test due to data volume and I'd need to run >> a few

Re: [sqlite] An interesting (strange) issue with selects

2012-06-23 Thread Dennis Volodomanov
On 22/06/2012 9:48 AM, Dennis Volodomanov wrote: I'll see if the new compilation options still make this happen, but it takes a couple of hours for each test due to data volume and I'd need to run a few tests (unless it occurs right away of course). I'll post back. This hasn't occurred

Re: [sqlite] fetching rows

2012-06-23 Thread Pavel Ivanov
No, SQLite doesn't do auto-commits every 25k insertions. It does auto-commit after each INSERT statement (no matter how many rows it inserts). If you wrap several INSERT statements into transaction it will execute faster. Pavel On Sat, Jun 23, 2012 at 3:13 PM, Durga D

Re: [sqlite] Different backend possible?

2012-06-23 Thread Pavel Ivanov
On Sat, Jun 23, 2012 at 2:28 PM, Simon Slavin wrote: > On 23 Jun 2012, at 7:14pm, "Peter M. Friedrich" > wrote: > >> do you think it's possible to create a different backend? I want to >> develop a relational database system

Re: [sqlite] fetching rows

2012-06-23 Thread Durga D
Thank you(Pavel) for the prompt response. Sqlite does auto commit for every 25k insertions. Do I need to change the number from 25k to x ( for ex: 100)? On Thu, Jun 21, 2012 at 7:54 AM, Pavel Ivanov wrote: > On Wed, Jun 20, 2012 at 11:33 PM, Durga D

Re: [sqlite] select ... where count(*)

2012-06-23 Thread giris
To: General Discussion of SQLite Database Sent: Saturday, June 23, 2012 1:21 PM Subject: Re: [sqlite] select ... where count(*) On Jun 23, 2012, at 7:19 PM, Patrik Nilsson wrote: > Great! This works better than mine suggestion. By the way… you might find the fine

Re: [sqlite] Different backend possible?

2012-06-23 Thread Simon Slavin
On 23 Jun 2012, at 7:14pm, "Peter M. Friedrich" wrote: > do you think it's possible to create a different backend? I want to > develop a relational database system which uses tables in FITS-files > (for details about this format see >

Re: [sqlite] Different backend possible?

2012-06-23 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 23/06/12 11:14, Peter M. Friedrich wrote: > do you think it's possible to create a different backend? You can use the SQL frontend of SQLite with you providing the underlying data by any appropriate means: http://www.sqlite.org/vtab.html It

[sqlite] Different backend possible?

2012-06-23 Thread Peter M. Friedrich
Hi all, do you think it's possible to create a different backend? I want to develop a relational database system which uses tables in FITS-files (for details about this format see http://fits.gsfc.nasa.gov/fits_standard.html). I guess it would be a good idea to use an approved database like

Re: [sqlite] select ... where count(*)

2012-06-23 Thread Petite Abeille
On Jun 23, 2012, at 7:19 PM, Patrik Nilsson wrote: > Great! This works better than mine suggestion. By the way… you might find the fine manual handy: http://www.sqlite.org/lang.html ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] select ... where count(*)

2012-06-23 Thread Patrik Nilsson
Great! This works better than mine suggestion. /Patrik On 06/23/2012 07:12 PM, Petite Abeille wrote: > > On Jun 23, 2012, at 6:55 PM, Patrik Nilsson wrote: > >> select id,count(*) from repetitionhistory where count(id)<3 group by id > > select id,count(*) from repetitionhistory group by id

[sqlite] Fwd: select ... where count(*)

2012-06-23 Thread Patrik Nilsson
select a,b from (select id as a,count(id) as b from repetitionhistory group by id) where b<3 Original Message Subject: select ... where count(*) Date: Sat, 23 Jun 2012 18:55:22 +0200 From: Patrik Nilsson To: General Discussion of SQLite Database

Re: [sqlite] select ... where count(*)

2012-06-23 Thread Petite Abeille
On Jun 23, 2012, at 6:55 PM, Patrik Nilsson wrote: > select id,count(*) from repetitionhistory where count(id)<3 group by id select id,count(*) from repetitionhistory group by id having count(id)<3 ___ sqlite-users mailing list

[sqlite] select ... where count(*)

2012-06-23 Thread Patrik Nilsson
Hi All, I want to write a statement like: (gives error on "count", misuse of aggregate: count()) select id,count(*) from repetitionhistory where count(id)<3 group by id This statement works when written without "where": select id,count(*) from repetitionhistory group by id But I'm only

Re: [sqlite] select count

2012-06-23 Thread Patrik Nilsson
Great! You solved my problem. /Patrik On 06/23/2012 06:28 PM, giris wrote: > Hi: > > > Assuming that the column in A is (for example) named x, the query will be > > select count(*), x from A group by x > > q.v "GROUP BY" > > HTH. > > Thanks > > > > From:

Re: [sqlite] select count

2012-06-23 Thread giris
Hi: Assuming that the column in A is (for example) named x, the query will be select count(*), x from A group by x q.v "GROUP BY" HTH. Thanks From: Patrik Nilsson To: General Discussion of SQLite Database

[sqlite] select count

2012-06-23 Thread Patrik Nilsson
Hi All, I have a table "a" which contains number like: 1 1 1 1 2 2 4 When I "select distinct * from a" I get: 1 2 4 How can I get the count for each number? Like this: 1|4 2|2 4|1 How do I write the needed select statement? Best regards, Patrik ___

Re: [sqlite] SQLite database on the android phone

2012-06-23 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 22/06/12 05:23, Pavel Ivanov wrote: > And if you include your populated database into application package > before installation and don't see any data after installation check > that you open your database with an absolute path otherwise you