On 13/12/2017 22:20, Simon Slavin wrote:

On 13 Dec 2017, at 8:34pm, Lifepillar <lifepil...@lifepillar.me> wrote:

But, (correct me if
I am wrong), if I index the blob column directly, comparisons are
based on memcpy(), which in my case is not what I want. Is it
possible to create an index that somehow uses a custom comparison
function instead? E.g., I have a deccmp(x,y) function that returns
-1 if x<y, 0 if x=y, and 1 if x>y. Can I define an index based on
that?

As Dr H wrote, it can’t be done.  Either store a normalised (numeric) version 
of the number, or store both the BLOB and a normalised version.

Thanks for the suggestion. Storing a normalized version side by side with the unnormalized number would work, but it would double the used space. Storing just the normalized number would lose information, though.

Life.

_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to