[sqlite] Is it possible that dropping a big table takes very long

2016-04-22 Thread Rowan Worth
On 22 April 2016 at 21:24, Adam Devita wrote: > > That said, why is the dropping of a table dependent on the size of > the table? Does Sqlite have to mark every block of memory it used as > dropped? (This is obvious for high security mode, but otherwise?) In rollback journal mode, every modif

[sqlite] No datasize field - why?

2016-04-22 Thread Igor Korot
Hi, Simon, On Fri, Apr 22, 2016 at 9:23 AM, Simon Slavin wrote: > > On 22 Apr 2016, at 2:09pm, Igor Korot wrote: > >> The field type is set to be "varchar(100)" for the name field. >> Wouldn't it be more logical to have it as "varchar" and have another field >> for data size? > > What you are se

[sqlite] Pretty-printing. Was: huge difference between clustered/nonclustered index usage

2016-04-22 Thread Dominique Devienne
On Fri, Apr 22, 2016 at 7:05 PM, Richard Hipp wrote: > In the next release, the ".schema" command will support a command-line > option "--indent" which does pretty-printing of the schema, turning > the above into the example shown below. The pretty-printer is simple > but it seems to work. Sou

[sqlite] huge difference between clustered/nonclustered index usage

2016-04-22 Thread Dominique Devienne
On Fri, Apr 22, 2016 at 6:55 PM, Richard Hipp wrote: > On 4/22/16, Dimitris Bilidas wrote: > > SELECT count(qview1."wlbWellboreName") FROM "discovery" qview2 CROSS > > JOIN "wellbore_development_all" qview1 WHERE > > (qview1."wlbNpdidWellbore" = qview2."wlbNpdidWellbore"); > > You are aware

[sqlite] No datasize field - why?

2016-04-22 Thread Darren Duncan
The general case of a data type definition is an arbitrarily complex predicate expression whose parts vary on the base type and other factors. Given this, if component details of type definitions were split out into their own table_info() columns, you'd have a large number of columns where mos

[sqlite] huge difference between clustered/nonclustered index usage

2016-04-22 Thread Dimitris Bilidas
Hello, I am using sqlite 3.12.2 and I am getting a strange behaviour from a very simple query. I am trying to understand the exact query plan and the cause of this problem. I would be grateful if someone could help me. The query is: SELECT count(qview1."wlbWellboreName") FROM "discovery" qview

[sqlite] Data integrity in sqlite in qt

2016-04-22 Thread kuppesh
Hi Users, Could you please guide me to understand data integrity in sqlite in qt framework? Regards, Kuppappa M.8747801297. E-Mail:kuppesh.ds at gmail.com

[sqlite] SQLITE_CANTOPEN on Android

2016-04-22 Thread Christian Werner
On 04/22/2016 03:46 PM, Richard Hipp wrote: > Why isn't /var/tmp or /tmp usable on Android? There ain't no "/var/tmp" nor "/tmp" on droids. Best of all worst alternatives is to use the application's own directory or better the subdir "cache" therein. Best, Christian

[sqlite] Is it possible that dropping a big table takes very long

2016-04-22 Thread Rowan Worth
On 22 April 2016 at 16:00, Cecil Westerhof wrote: > What I find very interesting is that the user time and the sys time does > not increase significantly, but the real time does. Does this point to the > problem, or is this to be expected? > It suggests the extra time is spent waiting for I/O (u

[sqlite] SQLITE_CANTOPEN on Android

2016-04-22 Thread Martin Trnovec
Yes looks like that "." folder is correctly detected to not have access and sqlite returns "error: SQLITE_IOERR: disk I/O error" which confirms the fix but still is there a preffered way how to set directory for those transition files , should we use env "SQLITE_TMPDIR" or is there a better w

[sqlite] No datasize field - why?

2016-04-22 Thread Dominique Devienne
On Fri, Apr 22, 2016 at 3:09 PM, Igor Korot wrote: > [code] > SQLite version 3.9.2 2015-11-02 18:31:45 > Enter ".help" for usage hints. > sqlite> PRAGMA table_info(leagues); > 0|id|integer|0||1 > 1|name|varchar(100)|0||0 > 2|drafttype|integer(1)|0||0 > 3|scoringtype|integer(1)|0||0 > 4|roundvalue

[sqlite] SQLITE_CANTOPEN on Android

2016-04-22 Thread Martin Trnovec
It seems that the problem is/was that the application can't create transient files in the "." directory returned by os_unix.c::unixTempFileDir due to Android os file restrictions. It also looks like that this function is not able to correctly check if the folder is writable for transient files

[sqlite] BUG?

2016-04-22 Thread Rowan Worth
On 22 April 2016 at 14:54, Stephan Beal wrote: > On Fri, Apr 22, 2016 at 8:43 AM, Clemens Ladisch > wrote: > > sqlite> select julianday('2000-01-01 00:00:00'); > > ...> select julianday('2000-01-01 00:00:01'); > > ...> select julianday('2000-01-01 00:00:02'); > > 2451544.5 > > 2451544

[sqlite] SQLITE_CANTOPEN on Android

2016-04-22 Thread Simon Slavin
On 22 Apr 2016, at 2:39pm, Martin Trnovec wrote: > but still is there a preffered way how to set directory for those transition > files , should we use env "SQLITE_TMPDIR" or is there a better way? Also, when is that variable read ? Is it read in sqlite3_initialize(), so you have to set it b

[sqlite] No datasize field - why?

2016-04-22 Thread Simon Slavin
On 22 Apr 2016, at 2:09pm, Igor Korot wrote: > The field type is set to be "varchar(100)" for the name field. > Wouldn't it be more logical to have it as "varchar" and have another field > for data size? What you are seeing there is SQLite just repeating back the type that the CREATE TABLE com

[sqlite] Is it possible that dropping a big table takes very long

2016-04-22 Thread Cecil Westerhof
2016-04-22 14:06 GMT+02:00 E.Pasma : > > 22 apr 2016, Cecil Westerhof: > >> >> ?With createBigTable.sh ... >> > Can you paste the svript in the message? Attachments are not sent. > ?createBigTable.sh: #/usr/bin/env bash # An error should terminate the script # An unset variable is also an error

[sqlite] Data integrity in sqlite in qt

2016-04-22 Thread Simon Slavin
On 22 Apr 2016, at 12:33pm, kuppesh wrote: > Could you please guide me to understand data integrity in sqlite in qt > framework? Can you ask your question another way ? Perhaps use simpler terms than 'data integrity' ? Are you worried about your data being lost ? Are you trying to make sure

[sqlite] Is it possible that dropping a big table takes very long

2016-04-22 Thread E.Pasma
22 apr 2016, Cecil Westerhof: > > ?With createBigTable.sh ... Can you paste the svript in the message? Attachments are not sent. Regards, E.Pasma

[sqlite] Pretty-printing. Was: huge difference between clustered/nonclustered index usage

2016-04-22 Thread Richard Hipp
On 4/22/16, Dimitris Bilidas wrote: > CREATE TABLE discovery( dscName TEXT,cmpLongName > TEXT,dscCurrentActivityStatus TEXT,dscHcType TEXT,wlbName TEXT,nmaName > TEXT,fldName TEXT,dscDateFromInclInField TEXT,dscDiscoveryYear > INTEGER,dscResInclInDiscoveryName TEXT,dscOwnerKind TEXT,dscOwnerName >

[sqlite] huge difference between clustered/nonclustered index usage

2016-04-22 Thread Richard Hipp
On 4/22/16, Dimitris Bilidas wrote: > > The query is: > SELECT count(qview1."wlbWellboreName") FROM "discovery" qview2 CROSS > JOIN "wellbore_development_all" qview1 WHERE > (qview1."wlbNpdidWellbore" = qview2."wlbNpdidWellbore"); You are aware that SQLite uses the CROSS JOIN syntax as a way

[sqlite] SQLITE_CANTOPEN on Android

2016-04-22 Thread Martin Trnovec
Hello, we are using sqlite 3.12.1 on Android device and we are tring to copy content of the one table into another table using INSERT OR REPLACE INTO SELECT * FROM This commad will fail on Android with error code SQLITE_CANTOPEN when - has any triggers configured (also empty one like "se

[sqlite] Is it possible that dropping a big table takes very long

2016-04-22 Thread Richard Hipp
On 4/22/16, Rowan Worth wrote: > > I've written this under the presumption that sqlite touches every database > page that was associated with a table during the delete/drop... I can think > of some optimisations allowing much of the i/o to be skipped (at least > least when secure_delete isn't set)

[sqlite] Is it possible that dropping a big table takes very long

2016-04-22 Thread Cecil Westerhof
2016-04-22 10:12 GMT+02:00 Rowan Worth : > On 22 April 2016 at 16:00, Cecil Westerhof wrote: > > > What I find very interesting is that the user time and the sys time does > > not increase significantly, but the real time does. Does this point to > the > > problem, or is this to be expected? > >

[sqlite] Is it possible that dropping a big table takes very long

2016-04-22 Thread Cecil Westerhof
2016-04-21 8:16 GMT+02:00 Cecil Westerhof : > > 2016-04-21 7:50 GMT+02:00 Cecil Westerhof : > >> ?I think it is an edge case. On my real system I only got this when there >> where 1E8 records. I am now testing on very old (8 year) hardware to and >> from work. >> The processor is: >> Intel(R)

[sqlite] Multiple in-memory database table query

2016-04-22 Thread Dominique Devienne
On Thu, Apr 21, 2016 at 8:20 PM, Dan Kennedy wrote: > Generally speaking, no matter how they are created, a given in-memory >> database has one and only one connection. You cannot, for example, use a >> URI ?filename? with mode=memory to open the same in-memory database more >> than once (I as

[sqlite] SQLITE_CANTOPEN on Android

2016-04-22 Thread Richard Hipp
On 4/22/16, Martin Trnovec wrote: > > but still is there a preffered way how to set directory for those > transition files , should we use env "SQLITE_TMPDIR" or is there a > better way? Setting SQLITE_TMPDIR is the preferred way. Why isn't /var/tmp or /tmp usable on Android? -- D. Richard Hip

[sqlite] Is it possible that dropping a big table takes very long

2016-04-22 Thread Adam Devita
In general, CPUs got much faster than disk IO a long time ago, so it is expected that a single thread, write through to disk program would have lots of time where the is CPU waiting for disk IO to complete. (BTW: A common error of novice db programmers is using a disk based db to store variables in

[sqlite] SQLITE_CANTOPEN on Android

2016-04-22 Thread Richard Hipp
On 4/22/16, Martin Trnovec wrote: > It seems that the problem is/was that the application can't create > transient files in the "." directory returned by > os_unix.c::unixTempFileDir due to Android os file restrictions. Does the fix at https://www.sqlite.org/src/info/67985761aa93fb61 help? > It

[sqlite] BUG?

2016-04-22 Thread Stephan Beal
On Fri, Apr 22, 2016 at 9:18 AM, Rowan Worth wrote: > On 22 April 2016 at 14:54, Stephan Beal wrote: > > but i beg to differ that that works in 100% of cases. > > > > Lets see, for a 64-bit float we have 53 bits of significand. The number > ...of ambiguity. Pretty sure your conversion issues are

[sqlite] No datasize field - why?

2016-04-22 Thread Igor Korot
Hi, ALL, [code] SQLite version 3.9.2 2015-11-02 18:31:45 Enter ".help" for usage hints. sqlite> PRAGMA table_info(league); sqlite> PRAGMA table_info(leagues); 0|id|integer|0||1 1|name|varchar(100)|0||0 2|drafttype|integer(1)|0||0 3|scoringtype|integer(1)|0||0 4|roundvalues|integer(1)|0||0 5|league

[sqlite] BUG?

2016-04-22 Thread Clemens Ladisch
Stephan Beal wrote: > On Fri, Apr 22, 2016 at 8:43 AM, Clemens Ladisch > wrote: >> You can get problems only if >> - you are not using enough precision, or >> - the number does not represent a full second, but some random point >> somewhere in the middle between two whole seconds. > > The latte

[sqlite] BUG?

2016-04-22 Thread Stephan Beal
On Fri, Apr 22, 2016 at 8:43 AM, Clemens Ladisch wrote: > Stephan Beal wrote: > > On Thu, Apr 21, 2016 at 4:12 PM, jrhgame wrote: > >> SELECT julianday('2016-04-15 12:10:10') ==>2457494.00706 > >> SELECT datetime(2457494.00706) ==>2016-04-15 12:10:09 > > > > fwiw, i've done lots and l

[sqlite] BUG?

2016-04-22 Thread Clemens Ladisch
Stephan Beal wrote: > On Thu, Apr 21, 2016 at 4:12 PM, jrhgame wrote: >> SELECT julianday('2016-04-15 12:10:10') ==>2457494.00706 >> SELECT datetime(2457494.00706) ==>2016-04-15 12:10:09 > > fwiw, i've done lots and lots of testing with round-trip conversions > between those two formats

[sqlite] BUG?

2016-04-22 Thread Stephan Beal
On Thu, Apr 21, 2016 at 4:12 PM, jrhgame wrote: > SELECT julianday('2016-04-15 12:10:10') ==>2457494.00706 > SELECT datetime(2457494.00706) ==>2016-04-15 12:10:09 > fwiw, i've done lots and lots of testing with round-trip conversions between those two formats, and it cannot be done 10

[sqlite] SQLITE_CANTOPEN on Android

2016-04-22 Thread Richard Hipp
On 4/22/16, Martin Trnovec wrote: > Hello, > > we are using sqlite 3.12.1 on Android device and we are tring to copy > content of the one table into another table using > > INSERT OR REPLACE INTO SELECT * FROM > > This commad will fail on Android with error code SQLITE_CANTOPEN when >- has

[sqlite] BUG?

2016-04-22 Thread Keith Medcalf
On Friday, 22 April, 2016 02:24. Stephan Beal said: > On Thu, Apr 21, 2016 at 4:12 PM, jrhgame wrote: > > SELECT julianday('2016-04-15 12:10:10') ==>2457494.00706 > > SELECT datetime(2457494.00706) ==>2016-04-15 12:10:09 > fwiw, i've done lots and lots of testing with round-trip con

[sqlite] Multiple in-memory database table query

2016-04-22 Thread Dan Kennedy
> Generally speaking, no matter how they are created, a given in-memory > database has one and only one connection. You cannot, for example, use a URI > ?filename? with mode=memory to open the same in-memory database more than > once (I assume that?s what you mean by ?by name??). For example