On 14/12/2017 13:14, Richard Hipp wrote:
On 12/14/17, Lifepillar <lifepil...@lifepillar.me> wrote:
I am not familiar with virtual tables yet, but I see that they are used,
for example, to implement Rtree indexes. Would it be feasible to
implement my own index structure as a virtual table and use it to index
a blob column in a standard table (or even just in the virtual table
itself)?
That would be complicated.
So, it is possible :)
A different idea. Suppose you have two new UDFs:
ieee754dec(X): Converts IEEE754-binary number X into IEEE754-decimal.
In other words it takes a "double" input and returns a "blob" output.
ieee754bin(Y): Converts IEEE754-decimal blob Y and converts it into
IEEE754-binary.
Both routines are approximate because most IEEE754-binary values do
not have an exact equivalent IEEE754-decimal representation and vice
versa. Your UDFs would need to find something very close.
Given these routines, you could then index your IEEE754-decimal
columns by doing an index on an expression using the new iee754bin()
function.
Thanks, that's another possibility to consider, although one typically
uses decimal values when exactness is needed; using your scheme
requires some care, I think, for example not to miss matches because of
approximations or to filter spurious matches away.
Somehow, I wish SQLite had something like PostgreSQL GiST indexes... ;)
Life.
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users