Re: [sqlite] Affinity of expression indexes

2018-12-13 Thread Jens Alfke
> On Dec 13, 2018, at 5:13 AM, Dan Kennedy wrote: > > The expression 'dog' also has no affinity (I think you're mistaken as to the > rules - but please correct me if that's not the case) You’re right — a literal has no affinity according to section 3.2. That surprised me. Thanks for the

Re: [sqlite] Affinity of expression indexes

2018-12-13 Thread Dan Kennedy
On 12/13/2018 07:41 AM, Jens Alfke wrote: Consider CREATE INDEX foo_idx ON tbl (myfunction(a)); where ‘myfunction’ is a deterministic C function I’ve registered with the SQLite connection (and ‘a’ is a column of ‘tbl’ of course.) SQLite has no idea what data type(s) ‘myfunction’ returns, and it

[sqlite] Affinity of expression indexes

2018-12-12 Thread Jens Alfke
Consider CREATE INDEX foo_idx ON tbl (myfunction(a)); where ‘myfunction’ is a deterministic C function I’ve registered with the SQLite connection (and ‘a’ is a column of ‘tbl’ of course.) SQLite has no idea what data type(s) ‘myfunction’ returns, and it might well return different data