Re: [sqlite] Truncation of floating point numbers in SQLite?

2015-01-30 Thread RSmith
On 2015/01/30 05:49, Donald Shepherd wrote: Trying to retrieve a stored qNaN or sNaN returns a column type of NULL and a value of 0. Thank you for letting us know. Well I suppose that's SQLite's method to answer with errors of the sort, returning NULL (as is the case with div0 for

Re: [sqlite] Truncation of floating point numbers in SQLite?

2015-01-30 Thread Stephan Beal
On Fri, Jan 30, 2015 at 3:45 AM, Donald Shepherd wrote: > I'm still not convinced whether it's the behaviour causing my problem, but > it does look like negative zero is another special case: > > SQLite version 3.8.7.2 2014-11-18 20:57:56 > Enter ".help" for usage

Re: [sqlite] "database disk image is malformed" error occurs more

2015-01-30 Thread Mario M. Westphal
- The databases in question are stored on a location hard disk or SSD. - If a user stores his database on a NAS box or Windows server, it is accessed directly, via standard Windows file system routines. - From what I can tell, network-based databases are not more likely to corrupt than

Re: [sqlite] "database disk image is malformed" error occurs more

2015-01-30 Thread Stephan Beal
On Fri, Jan 30, 2015 at 1:45 PM, Mario M. Westphal wrote: > - From what I can tell, network-based databases are not more likely to > corrupt than databases stored on built-in disks or SSDs or databases kept > on disks or USB sticks connected via USB. > That's a big assumption.

Re: [sqlite] "database disk image is malformed" error occurs more

2015-01-30 Thread RSmith
On 2015/01/30 14:45, Mario M. Westphal wrote: - The databases in question are stored on a location hard disk or SSD. - If a user stores his database on a NAS box or Windows server, it is accessed directly, via standard Windows file system routines. - From what I can tell, network-based

Re: [sqlite] "database disk image is malformed" error occurs more

2015-01-30 Thread Mario M. Westphal
> Okay. First, stop doing VACUUM after this. You're not improving things and > you may be making things worse Not important. If this error is encountered the database is marked and the user reminded on every open/close to replace it with a backup. The database is not supposed to be used

Re: [sqlite] "database disk image is malformed" error occurs more

2015-01-30 Thread Simon Slavin
On 30 Jan 2015, at 1:07pm, Mario M. Westphal wrote: > What worries me more are the incidents where users see this problem happen > several times, with q database kept on a local hard disk or SSD. Just to make it clear, when corruption is reported, the corruption is not

Re: [sqlite] ROWID-based queries slow in FTS db

2015-01-30 Thread Dan Kennedy
On 01/29/2015 02:29 AM, farkas andras wrote: Hi all, Im using FTS through DBD::SQLite (perl) to query large text databases (~10GB, ~10 million records). The regular FTS MATCH searches work fine (they usually run under a second), but searches based on ROWID are atrociously slow and hog massive

Re: [sqlite] ROWID-based queries slow in FTS db

2015-01-30 Thread Dominique Devienne
On Fri, Jan 30, 2015 at 4:38 PM, Dan Kennedy wrote: > On 01/29/2015 02:29 AM, farkas andras wrote: > >> [...] but searches based on ROWID are atrociously slow and hog massive >> amounts of memory [...] >> > > Looks like range constraints on rowids were only taken into

Re: [sqlite] ROWID-based queries slow in FTS db

2015-01-30 Thread Dan Kennedy
On 01/30/2015 10:49 PM, Dominique Devienne wrote: On Fri, Jan 30, 2015 at 4:38 PM, Dan Kennedy wrote: On 01/29/2015 02:29 AM, farkas andras wrote: [...] but searches based on ROWID are atrociously slow and hog massive amounts of memory [...] Looks like range

Re: [sqlite] Best Practice for read-only access

2015-01-30 Thread Duquette, William H (393K)
On 1/29/15 5:48 PM, "Richard Hipp" wrote: >On 1/29/15, Duquette, William H (393K) >wrote: >> Howdy! >> >> I've got an object that encapsulates access to an SQLite database, >>i.e., all >> writes to the database are done in terms of method calls

Re: [sqlite] ROWID-based queries slow in FTS db

2015-01-30 Thread farkas andras
Thank you for the quick fix and the info, I will wait for 3.8.9 to trickle down into DBD::SQLite. AF Dan Kennedy írta: >On 01/30/2015 10:49 PM, Dominique Devienne wrote: >> On Fri, Jan 30, 2015 at 4:38 PM, Dan Kennedy wrote: >> >>> On 01/29/2015

Re: [sqlite] "database disk image is malformed" error occurs more

2015-01-30 Thread Stephen Chrzanowski
On Fri, Jan 30, 2015 at 8:07 AM, Mario M. Westphal wrote: > > When a user encounters the problem he/she restores the last working > backup. I have a few users who faced this problem more than once. Here I > always assumed some hardware glirch, a shaky USB connection, disk

Re: [sqlite] "database disk image is malformed" error occurs more

2015-01-30 Thread Mario M. Westphal
I estimate that over 90% of the users keep the database on local disks. I can tell from the log files. Keeping the SQLite database it on a network server really hurts performance. That’s not what SQLite is designed for, besides all other aspects of network locking mentioned in various SQLite

[sqlite] Custom functions, variable parameters, and SELECT triggers

2015-01-30 Thread David Barrett
Is it possible to create a trigger that calls a custom function and passes in NEW.*? To break that question down: 1) I know it's possible to create custom functions that take a variable number of parameters. 2) I'm *assuming* if you pass a "*" into that function, it'll just call that function

Re: [sqlite] Custom functions, variable parameters, and SELECT triggers

2015-01-30 Thread Igor Tandetnik
On 1/30/2015 10:44 PM, David Barrett wrote: Is it possible to create a trigger that calls a custom function and passes in NEW.*? Not literally NEW.* . You'll have to spell out individual columns as parameters. 2) I'm *assuming* if you pass a "*" into that function, it'll just call that

[sqlite] expected performance of selecting large numbers of records

2015-01-30 Thread Godmar Back
I have a single SQLite 2-column table with a primary TEXT key and a value, like so (id TEXT PRIMARY KEY, value TEXT). One process adds new records periodically, perhaps 1-10 per minute. The database currently has 850,000 entries and is 7.3GB large on disk. I also need to perform bulk queries,

Re: [sqlite] Custom functions, variable parameters, and SELECT triggers

2015-01-30 Thread Tristan Van Berkom
On Sat, 2015-01-31 at 00:04 -0500, Igor Tandetnik wrote: > On 1/30/2015 10:44 PM, David Barrett wrote: > > Is it possible to create a trigger that calls a custom function and passes > > in NEW.*? > > Not literally NEW.* . You'll have to spell out individual columns as > parameters. > > > 2) I'm