[sqlite] Select time('now')

2012-04-13 Thread YAN HONG YE
the current time is 15:15 when I use this following command: sqlite> Select time('now'); return 07:15:42 not current time,why? ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Re: [sqlite] Using \"attach database\" to work around DB locking

2012-04-13 Thread Gabriel Corneanu
Or you can do your immediate writing to a database in memory, and have anotherprocess dump memory to disk in the background. Depending on how recent youneed reading you can read the one in memory or the one on disk. It seems I have reached the CPU boundary (>90% one 1 core), not waiting

Re: [sqlite] Select time('now')

2012-04-13 Thread Steinar Midtskogen
YAN HONG YE writes: > the current time is 15:15 > when I use this following command: > sqlite> Select time('now'); > return 07:15:42 > not current time,why? Read http://www.sqlite.org/lang_datefunc.html "Format 11, the string 'now', is converted into the current date and

Re: [sqlite] to joe mistachkin - Ticket 4bbf851fa5

2012-04-13 Thread Simon Hucksley
on http://www.sqlite.org/src/wiki?name=Bug+Reports I read "The idea is that bug reports can be filtered on the mailing list and those that are actual new bugs can be transferred into our bug tracking system by registered developers. * Anonymous users can continue to append comments to existing

Re: [sqlite] Using \"attach database\" to work around DB locking

2012-04-13 Thread Simon Slavin
On 13 Apr 2012, at 8:41am, "Gabriel Corneanu" wrote: >> Or you can do your immediate writing to a database in memory, and have >> anotherprocess dump memory to disk in the background. Depending on how >> recent youneed reading you can read the one in memory or the

Re: [sqlite] Select time('now')

2012-04-13 Thread Igor Tandetnik
YAN HONG YE wrote: > the current time is 15:15 > when I use this following command: > sqlite> Select time('now'); > return 07:15:42 > not current time,why? Make it select time('now', 'localtime'); 7:15 is the time in UTC. -- Igor Tandetnik

Re: [sqlite] Using \"attach database\" to work around DB locking

2012-04-13 Thread Stephan Beal
On Fri, Apr 13, 2012 at 9:56 AM, Simon Slavin wrote: > Actually I'd like to apologise for posting the above. I forgot that every > process has its own ':memory:'. If you use a different process to look at > ':memory:' it won't see the database. Sorry about that. You

[sqlite] MIGRATING BLOB FIELD FIREBIRD TO SQLITE

2012-04-13 Thread Cezar Moniz
Dear users. I am a beginner in using sqlite. I am having difficulty importing firebird blob fields for sqlite blob fields. Some help? My best regards -- [ ]´s Cezar Moniz "O emitente desta mensagem é responsável por seu conteúdo e endereçamento. Cabe ao destinatário cuidar quanto ao

[sqlite] Why are two select statements 2000 times faster than one?

2012-04-13 Thread Steinar Midtskogen
Hello, I have a table with "unix_time" as primary key and I want to get the minimum and maximum values of "unix_time". When I do: SELECT min(unix_time), max(unix_time) from table; it is very slow. It takes about 250ms, nearly everything in the step() call. However, if I do: SELECT

Re: [sqlite] Why are two select statements 2000 times faster than one?

2012-04-13 Thread Marc L. Allen
Maybe the query analyzer isn't smart enough to do two seeks in this case, so it does a scan? > -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Steinar Midtskogen > Sent: Friday, April 13, 2012 3:00 PM > To:

Re: [sqlite] Why are two select statements 2000 times faster than one?

2012-04-13 Thread Alessandro Marzocchi
What does EXPLAIN QUERY PLAN says? Il giorno 13 aprile 2012 21:04, Marc L. Allen ha scritto: > Maybe the query analyzer isn't smart enough to do two seeks in this case, > so it does a scan? > > > -Original Message- > > From: sqlite-users-boun...@sqlite.org

Re: [sqlite] Why are two select statements 2000 times faster than one?

2012-04-13 Thread Steinar Midtskogen
Alessandro Marzocchi writes: > What does EXPLAIN QUERY PLAN says? sqlite> EXPLAIN QUERY PLAN SELECT min(unix_time) FROM table; 0|0|0|SEARCH TABLE table USING INTEGER PRIMARY KEY (~1 rows) sqlite> EXPLAIN QUERY PLAN SELECT max(unix_time) FROM table; 0|0|0|SEARCH

Re: [sqlite] Why are two select statements 2000 times faster than one?

2012-04-13 Thread Igor Tandetnik
On 4/13/2012 2:59 PM, Steinar Midtskogen wrote: I have a table with "unix_time" as primary key and I want to get the minimum and maximum values of "unix_time". When I do: SELECT min(unix_time), max(unix_time) from table; it is very slow. It takes about 250ms, nearly everything in the

Re: [sqlite] Why are two select statements 2000 times faster than one?

2012-04-13 Thread Puneet Kishor
Try the following sqlite> EXPLAIN QUERY PLAN SELECT Min(a) FROM t UNION ALL SELECT Max(a) FROM t; selectid|order|from|detail 1|0|0|SEARCH TABLE t USING INTEGER PRIMARY KEY (~1 rows) 2|0|0|SEARCH TABLE t USING INTEGER PRIMARY KEY (~1 rows) 0|0|0|COMPOUND SUBQUERIES 1 AND 2 (UNION ALL) Should be a

Re: [sqlite] Why are two select statements 2000 times faster than one?

2012-04-13 Thread Steinar Midtskogen
Puneet Kishor writes: > If you want the results in separate columns, you can do something like > > SELECT Min(a) minimum, 'none' maximum FROM t UNION ALL SELECT 'none' minimum, > Max(a) minimum FROM t; Then it does a full scan again. But Igor's suggestion "SELECT (SELECT

Re: [sqlite] Why are two select statements 2000 times faster than one?

2012-04-13 Thread Puneet Kishor
On Apr 13, 2012, at 3:14 PM, Steinar Midtskogen wrote: > Puneet Kishor writes: > >> If you want the results in separate columns, you can do something like >> >> SELECT Min(a) minimum, 'none' maximum FROM t UNION ALL SELECT 'none' >> minimum, Max(a) minimum FROM t; > >

[sqlite] Version 3.7.11

2012-04-13 Thread Pete
A couple of things in the Release Notes for 3.7.11 caught my eye: - ability to insert muyltiple rows in one INSERT command - improvements to the handling of csv inputs in sqlite3 Is there more detailed information available about these changes. For example,the INSERT syntax diagram/description

Re: [sqlite] Version 3.7.11

2012-04-13 Thread Simon Slavin
On 13 Apr 2012, at 9:54pm, Pete wrote: > A couple of things in the Release Notes for 3.7.11 caught my eye: > > - ability to insert muyltiple rows in one INSERT command > - improvements to the handling of csv inputs in sqlite3 > > Is there more detailed information

Re: [sqlite] Version 3.7.11

2012-04-13 Thread Richard Hipp
On Fri, Apr 13, 2012 at 4:54 PM, Pete wrote: > A couple of things in the Release Notes for 3.7.11 caught my eye: > > - ability to insert muyltiple rows in one INSERT command > - improvements to the handling of csv inputs in sqlite3 > > Is there more detailed information

Re: [sqlite] Why are two select statements 2000 times faster than one?

2012-04-13 Thread Dan Kennedy
On 04/14/2012 03:14 AM, Steinar Midtskogen wrote: Puneet Kishor writes: If you want the results in separate columns, you can do something like SELECT Min(a) minimum, 'none' maximum FROM t UNION ALL SELECT 'none' minimum, Max(a) minimum FROM t; Then it does a full scan