It should be possible to make the query optimizer to automatically figure out whether or not a view is deterministic. However, this doesn't work for virtual tables, unless it is enhanced by adding a `SQLITE_INDEX_SCAN_DETERMINISTIC` flag (or a `SQLITE_VTAB_DETERMINISTIC` option). (I think there are other messages on this forum describing proposed improvement of virtual table.)