Re: [sqlite] How to optimize a select that gets 17 rows from a 700k row DB (via perl using DBI)?

2007-01-13 Thread Nicolas Williams
On Sat, Jan 13, 2007 at 12:57:43AM -0500, [EMAIL PROTECTED] wrote: The SQLite database is INSERTed into because I want to keep historical data. The rationale for this is explained later. For your main application (finding the least loaded

[sqlite] SQLITE_ENABLE_LOCKING_STYLE

2007-01-13 Thread Marco Bambini
I am sorry if the question is too obvious but I haven't found any documentation about the SQLITE_ENABLE_LOCKING_STYLE macro (it is in os.c). Should I set it to 0 (default) or 1? I need to be able to access database files located on shared volumes on OS X. Which are the implications of

Re: [sqlite] 3.3.10 data corruption on updating fts1 string table

2007-01-13 Thread ohadp
Glad I could help find something, hope I put you in the right direction with the source sample. In the meantime I've moved to standard tables due to other limitations imposed by FTS1/2. Scott Hess wrote: OK, there's definite meat, here. I have other reports of users seeing this problem.

Re: [sqlite] How to optimize a select that gets 17 rows from a 700k row DB (via perl using DBI)?

2007-01-13 Thread Jay Sprenkle
Have you considered running a process that summarizes the data from the table and just fetching the last summary for display? Will a periodic snapshot work for your reporting or do you need realtime summarization? On 1/12/07, [EMAIL PROTECTED] [EMAIL PROTECTED] wrote: Hi all. I will try to

[sqlite] A little help with count

2007-01-13 Thread Lloyd Thomas
I wish to create a query where I do a number of counts on the same table but with different filters. ie: count(id) as numrows count(id) as inrows where direction = 'In' count(id) as outrows where direction = 'Out' Could I do the above in a single query? | id | date | direction |

Re: [sqlite] A little help with count

2007-01-13 Thread Cesar Rodas
select count(id), numrows as type from table union select count(id), inrows as type from table where direction = 'In' union select count(id) as id, outrows as type from table where direction = 'Out' This could be? I am sorry that i can't try here, because i am not in my work or my home, and

[sqlite] Re: A little help with count

2007-01-13 Thread Igor Tandetnik
Lloyd Thomas lloydie-t-d/OCxD/[EMAIL PROTECTED] wrote: I wish to create a query where I do a number of counts on the same table but with different filters. ie: count(id) as numrows count(id) as inrows where direction = 'In' count(id) as outrows where direction = 'Out' Could I do the above in

Re: [sqlite] Re: A little help with count

2007-01-13 Thread Cesar Rodas
Great solution Igor! On 13/01/07, Igor Tandetnik [EMAIL PROTECTED] wrote: Lloyd Thomas lloydie-t-d/OCxD/[EMAIL PROTECTED] wrote: I wish to create a query where I do a number of counts on the same table but with different filters. ie: count(id) as numrows count(id) as inrows where

[sqlite] Re: How to optimize a select that gets 17 rows from a 700k row DB (via perl using DBI)?

2007-01-13 Thread Jonathan . W . Crane
First off, thanks for the help and sorry for the formatting of the message. I didn't know how it was going to turn out and I probably was overly optimistic as well as too verbose. Secondly, as I feared, seems like it was an XY question, so sorry for that as well. I'll address the two replies

[sqlite] Of shared cache, table locks and transactions

2007-01-13 Thread Peter James
Hey folks... I have a situation that caused me a little head-scratching and I'm wondering if it's intended behavior or not. I'm running a server thread (roughly based on test_server.c in the distro) on top of the 3.3.6 library. The effectve call sequence in question (all from one thread) looks