Dan Kennedy wrote: > I don't think the triggers you are using can be implemented using > foreign keys. Your triggers are basically reference counting (or > garbage collecting, whatever you want to call it) - "when the > number of references to a data item drops to zero, delete the > data item". > Yes, exactly. > You could add a foreign key to this schema to prevent the DataID > column of TableA from being populated with an invalid id (one > that does not refer to any id of the TableData table). > I do that check when I add entries to TableA in any case, so probably that's best left as-is.
Is there any gain in terms of performance when doing lookups on TableA with JOINs with TableData when there're FOREIGN KEYs defined? Does SQLite internally optimize queries better in such cases? Thank you, Dennis _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users