[sqlite] Invitation to connect on LinkedIn

2011-08-16 Thread daisy zhang via LinkedIn
LinkedIn daisy zhang requested to add you as a connection on LinkedIn: -- Zarko, I'd like to add you to my professional network on LinkedIn. - daisy Accept invitation from daisy zhang

[sqlite] Improving the query optimizer

2011-08-16 Thread Filip Navara
Hello! Over the last few weeks we were profiling our usage of SQLite. We found three common patterns that are not treated well by the optimizer. I believe at least two of them can be fixed easily and they are included below. 1) Consider the following schema: create table a (a, b, c, d); create

[sqlite] Query optimizer and foreign keys

2011-08-16 Thread Filip Navara
Hello! I'm seeking some advice on improving SQLite's query planning in relation to foreign keys. Sometimes it may be useful to exploit the fact that the columns in separate tables refer to the same information. Consider the following schema: create table a (a, b, c); create table b (a, b

[sqlite] Version 3.7.8

2011-08-16 Thread Filip Navara
Is version 3.7.8 scheduled for September 28 (according to changes.in) or August 28 (bi-monthly schedule)? Thanks, Filip Navara ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

[sqlite] Using dot commands with the command line binary

2011-08-16 Thread Ryan Henrie
I finally figured out how to load multiple dot commands or settings from the command line tool. (Some users only have the default binary to rely on, ya know.) Since I have never found this information on the web before, I thought I would post it here to share the information. To load options

Re: [sqlite] Using dot commands with the command line binary

2011-08-16 Thread Brian Curley
Use of a heredoc to simulate a session...or staging it all into a file for use via .read are good too. On Aug 16, 2011 6:55 AM, Ryan Henrie r...@henrie.org wrote: I finally figured out how to load multiple dot commands or settings from the command line tool. (Some users only have the default

[sqlite] forcing X'' literals in sqlite3's .dump?

2011-08-16 Thread Ivan Shmakov
In the sqlite3's .dump command's output, the binary blobs may either be represented as hexadecimal X''-literals, or as text strings. I wonder, how do I force sqlite3(1) to exclusively use the X'' representation? Also, are the .dump and .read

Re: [sqlite] Version 3.7.8

2011-08-16 Thread Richard Hipp
On Tue, Aug 16, 2011 at 5:37 AM, Filip Navara filip.nav...@gmail.comwrote: Is version 3.7.8 scheduled for September 28 (according to changes.in) or August 28 (bi-monthly schedule)? Current target release date is 2011-09-28. But that might change. Meanwhile, the trunk is stable if you want to

Re: [sqlite] Improving the query optimizer

2011-08-16 Thread Simon Slavin
On 16 Aug 2011, at 9:39am, Filip Navara wrote: create table a (a, b, c, d); create index aIdx on a (a, d); Now the data in columns b and c can be pretty large. Let's make the following query: select a, d from a; Full-table scan is done even if an index exists that covers all the

Re: [sqlite] Improving the query optimizer

2011-08-16 Thread Filip Navara
On Tue, Aug 16, 2011 at 2:24 PM, Simon Slavin slav...@bigfraud.org wrote: On 16 Aug 2011, at 9:39am, Filip Navara wrote: create table a (a, b, c, d); create index aIdx on a (a, d); Now the data in columns b and c can be pretty large. Let's make the following query: select a, d from a;

Re: [sqlite] Improving the query optimizer

2011-08-16 Thread Richard Hipp
On Tue, Aug 16, 2011 at 8:54 AM, Filip Navara filip.nav...@gmail.comwrote: On Tue, Aug 16, 2011 at 2:24 PM, Simon Slavin slav...@bigfraud.org wrote: On 16 Aug 2011, at 9:39am, Filip Navara wrote: create table a (a, b, c, d); create index aIdx on a (a, d); Now the data in columns b

Re: [sqlite] Improving the query optimizer

2011-08-16 Thread Filip Navara
On Tue, Aug 16, 2011 at 2:56 PM, Richard Hipp d...@sqlite.org wrote: On Tue, Aug 16, 2011 at 8:54 AM, Filip Navara filip.nav...@gmail.comwrote: On Tue, Aug 16, 2011 at 2:24 PM, Simon Slavin slav...@bigfraud.org wrote: On 16 Aug 2011, at 9:39am, Filip Navara wrote: create table a (a, b,

Re: [sqlite] Improving the query optimizer

2011-08-16 Thread Filip Navara
On Tue, Aug 16, 2011 at 2:54 PM, Filip Navara filip.nav...@gmail.com wrote: On Tue, Aug 16, 2011 at 2:24 PM, Simon Slavin slav...@bigfraud.org wrote: On 16 Aug 2011, at 9:39am, Filip Navara wrote: create table a (a, b, c, d); create index aIdx on a (a, d); Now the data in columns b and c

Re: [sqlite] Version 3.7.8

2011-08-16 Thread Filip Navara
On Tue, Aug 16, 2011 at 2:19 PM, Richard Hipp d...@sqlite.org wrote: On Tue, Aug 16, 2011 at 5:37 AM, Filip Navara filip.nav...@gmail.comwrote: Is version 3.7.8 scheduled for September 28 (according to changes.in) or August 28 (bi-monthly schedule)? Current target release date is 2011-09-28.

Re: [sqlite] Improving the query optimizer

2011-08-16 Thread Simon Slavin
On 16 Aug 2011, at 1:54pm, Filip Navara wrote: On Tue, Aug 16, 2011 at 2:24 PM, Simon Slavin slav...@bigfraud.org wrote: On 16 Aug 2011, at 9:39am, Filip Navara wrote: Full-table scan is done even if an index exists that covers all the data required by the query. That's a little

[sqlite] aggregate by break in sequence

2011-08-16 Thread Anantha Prasad
Wanted to know if Sqlite can do simple math when there is a break in sequence in the data. For example the foll. table is sorted by Longitude and then Distance: Id Longitude Distance IVmean IVsum IVcount 42 71.0 10 10.5000 221 43 71.0 10 29.4286 28

Re: [sqlite] aggregate by break in sequence

2011-08-16 Thread Jim Morris
You can't replace multiple rows in a single insert/update/delete statement. You might consider copying the duplicates to a temp table, delete them from the old then use a select on the temp table to generate the new rows for the old table. The select portion would be something like select

Re: [sqlite] aggregate by break in sequence

2011-08-16 Thread Pavel Ivanov
I think it will have better performance if you do that in your programming language. But if you insist on SQL it would look like this: update table_name set IVmean = (select sum(IVsum)/sum(IVcount) from table_name t where t.Longitude = table_name.Longitude and t.Distance = table_name.Distance);

[sqlite] How to search the archives for [MEMO]?

2011-08-16 Thread Dave Jeremy
Hi, New to SQLite3 and am I using Delphi-5 and Zeos. I created a database using the Text DataType but it shows up in a TDBGrid as [memo]. I have read that I need to change the DataType to VarChar without a length designation and the text will show correctly. I am sure this has been asked a

Re: [sqlite] How to search the archives for [MEMO]?

2011-08-16 Thread Luuk
On 16-08-2011 20:15, Dave Jeremy wrote: Hi, New to SQLite3 and am I using Delphi-5 and Zeos. I created a database using the Text DataType but it shows up in a TDBGrid as [memo]. I have read that I need to change the DataType to VarChar without a length designation and the text will

Re: [sqlite] How to search the archives for [MEMO]?

2011-08-16 Thread Dave Jeremy
On 8/16/2011 12:12 PM, Luuk wrote: On 16-08-2011 20:15, Dave Jeremy wrote: Hi, New to SQLite3 and am I using Delphi-5 and Zeos. I created a database using the Text DataType but it shows up in a TDBGrid as [memo]. I have read that I need to change the DataType to VarChar without a length

Re: [sqlite] aggregate by break in sequence

2011-08-16 Thread Anantha Prasad
Thanks much for the responses - they were helpful but was not quite what i wanted. Perhaps I was not clear. So, here goes... The data is sorted by Longitude and then by Distance. Whenever there are repeated values of Distance within a Longitude, I want the Sum and Count to be added and divided -

[sqlite] select distinct

2011-08-16 Thread Yonnas Beyene
In the process of converting database from sql express to sqlite, I have the following query that runs very slow on sqlite compared to sql server: SELECT distinct Table1.Column1, Table2.Column2, Table1.Column2 FROM ( Table1 INNER JOIN Table2 ON Table1.Column1 = Table2.Column1) WHERE (

Re: [sqlite] aggregate by break in sequence

2011-08-16 Thread Simon Slavin
On 16 Aug 2011, at 9:58pm, Anantha Prasad wrote: The data is sorted by Longitude and then by Distance. Whenever there are repeated values of Distance within a Longitude, I want the Sum and Count to be added and divided - for example, Here is the table: Longitude Distance AvgColz SumColz

Re: [sqlite] select distinct

2011-08-16 Thread Simon Slavin
On 16 Aug 2011, at 10:05pm, Yonnas Beyene wrote: SELECT distinct Table1.Column1, Table2.Column2, Table1.Column2 FROM ( Table1 INNER JOIN Table2 ON Table1.Column1 = Table2.Column1) WHERE ( Table1.PrimaryKeyID =?) And ( Table1.Column1 IS NOT NULL) The explain query plan looks like, 0 0 0

Re: [sqlite] aggregate by break in sequence

2011-08-16 Thread Igor Tandetnik
On 8/16/2011 4:58 PM, Anantha Prasad wrote: The data is sorted by Longitude and then by Distance. Whenever there are repeated values of Distance within a Longitude, I want the Sum and Count to be added and divided select Longitude, Distance, sum(SumColz) / sum(CountColz) as AvgColz from