Drop the view, add a new column “last_retrieval_datetime” to the table urls, 
and whenever fetch a page, update this column

发自我的 iPhone

> 在 2018年3月19日,06:15,Clemens Ladisch <[email protected]> 写道:
> 
> I have not looked at the schema and queries in detail.
> But at a first glance:
> 
>> CREATE VIEW v_most_recent_lookup_per_url AS
>>     ...
>>     ORDER BY url_id;
> 
> Drop the ORDER BY; it is useless in a view used in another query,
> and just might slow things down.
> 
>> 0    1    1    SEARCH TABLE lookups AS l USING AUTOMATIC COVERING INDEX 
>> (is_generic_flag=? AND url_id=?)
> 
> If SQLite thinks that an AUTOMATIC index is useful, you should consider
> creating it explicitly:
>  CREATE INDEX lookup_generid_id_idx ON lookups(is_generic_flag, url_id);
> 
> 
> Regards,
> Clemens
> _______________________________________________
> sqlite-users mailing list
> [email protected]
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to