On 7 Dec 2016, at 8:40pm, David Raymond <david.raym...@tomtom.com> wrote:

> Question on making indexes for the child fields of foreign keys. I have a 
> child table with a number of foreign keys on fields which the majority of the 
> time are null. I've currently got indexes on the child fields for the 
> purposes of speeding up the foreign key checks, but what I'm wondering is if 
> I used a conditional index which has "where fkField is not null", will that 
> index be usable by the internal foreign key checker?

Sorry, but the answer is no.  SQLite needs to be able to find the rows where 
the key-value is NULL.  It can’t do that from an index which doesn’t include 
those rows.

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

Reply via email to