[sqlite] Using collation instead a virtual table

2015-09-10 Thread Eduardo Morras
On Wed, 9 Sep 2015 09:54:28 -0400 Igor Tandetnik wrote: > On 9/9/2015 6:54 AM, Eduardo Morras wrote: > > Yes, the comparison operators work correctly and the b-tree binary > > search should give correct answers, the only tweak is in xCompare, > > that returns 0 when left(x) and rigth($value)

[sqlite] Using collation instead a virtual table

2015-09-10 Thread Constantine Yannakopoulos
On Wed, Sep 9, 2015 at 10:59 PM, Scott Doctor wrote: > > Best practice when dealing with floating point is to normalize and Chop. In my line of business (ledger/ERP/retail) I don't think I can normalize but chopping is definitely performed ?on each operation that can produce rounding errors.

[sqlite] Using collation instead a virtual table

2015-09-09 Thread Constantine Yannakopoulos
On Wed, Sep 9, 2015 at 9:47 PM, R.Smith wrote: > > On 2015-09-09 05:19 PM, Constantine Yannakopoulos wrote: > >> On Wed, Sep 9, 2015 at 4:54 PM, Igor Tandetnik >> wrote: >> >> ?Out of curiosity, doesn't this also apply also to numeric (real number) >> comparisons since SQLite3 uses IEEE

[sqlite] Using collation instead a virtual table

2015-09-09 Thread R.Smith
On 2015-09-09 09:02 PM, Constantine Yannakopoulos wrote: > On Wed, Sep 9, 2015 at 9:47 PM, R.Smith wrote: > >> On 2015-09-09 05:19 PM, Constantine Yannakopoulos wrote: >> >>> On Wed, Sep 9, 2015 at 4:54 PM, Igor Tandetnik >>> wrote: >>> >>> ?Out of curiosity, doesn't this also apply also to

[sqlite] Using collation instead a virtual table

2015-09-09 Thread R.Smith
On 2015-09-09 05:19 PM, Constantine Yannakopoulos wrote: > On Wed, Sep 9, 2015 at 4:54 PM, Igor Tandetnik wrote: > >> A comparison like this would not generally be a proper collation. The >> equivalence relation it induces is not transitive - it's possible to have A >> == B and B == C but A !=

[sqlite] Using collation instead a virtual table

2015-09-09 Thread Constantine Yannakopoulos
On Wed, Sep 9, 2015 at 4:54 PM, Igor Tandetnik wrote: > A comparison like this would not generally be a proper collation. The > equivalence relation it induces is not transitive - it's possible to have A > == B and B == C but A != C (when A is "close enough" to B and B is "close > enough" to C,

[sqlite] Using collation instead a virtual table

2015-09-09 Thread Scott Doctor
Best practice when dealing with floating point is to normalize and Chop. The best practice for dealing with floating point operations is to normalize your data sets before proceeding. All numbers should be -1.0<=x<=1.0. Done properly, after calculations are complete, the data set is easily

[sqlite] Using collation instead a virtual table

2015-09-09 Thread Eduardo Morras
On Tue, 8 Sep 2015 15:42:28 -0400 Richard Hipp wrote: > On 9/8/15, Eduardo Morras wrote: > > > > > > Hello, > > > > I have a virtual table that implements query perceptual hashing data > > [1]. Now I'm thinking about converting the virtual table > > implementation in a collation on a normal

[sqlite] Using collation instead a virtual table

2015-09-09 Thread Igor Tandetnik
On 9/9/2015 11:19 AM, Constantine Yannakopoulos wrote: > On Wed, Sep 9, 2015 at 4:54 PM, Igor Tandetnik wrote: > >> A comparison like this would not generally be a proper collation. The >> equivalence relation it induces is not transitive - it's possible to have A >> == B and B == C but A != C

[sqlite] Using collation instead a virtual table

2015-09-09 Thread Igor Tandetnik
On 9/9/2015 6:54 AM, Eduardo Morras wrote: > Yes, the comparison operators work correctly and the b-tree binary search > should give correct answers, the only tweak is in xCompare, that returns 0 > when left(x) and rigth($value) expressions distance is lower than a threshold. A comparison like

[sqlite] Using collation instead a virtual table

2015-09-08 Thread Eduardo Morras
Hello, I have a virtual table that implements query perceptual hashing data[1]. Now I'm thinking about converting the virtual table implementation in a collation on a normal sqlite3 table, but collation requieres that '=','<' and '>' be well defined by obeying the rules cited on

[sqlite] Using collation instead a virtual table

2015-09-08 Thread Richard Hipp
On 9/8/15, Eduardo Morras wrote: > > > Hello, > > I have a virtual table that implements query perceptual hashing data[1]. Now > I'm thinking about converting the virtual table implementation in a > collation on a normal sqlite3 table, but collation requieres that '=','<' > and '>' be well