On 10/30/17, Wout Mertens <wout.mert...@gmail.com> wrote: >> WHERE STRFTIME('%Y-%m-%d %H:%M', timestamp) = STRFTIME('%Y-%m-%d %H:%M', > 'now', 'localtime', '-1 minute'); > > Won't this run strftime on all rows? Unless you have a calculated index on > that strftime function, I think you should convert the 'now' to a timestamp… >
The first STRFTIME() does run for every row, because timestamp is different for every row. But the second STRFTIME() should be factored out and run only once. Please verify that this is happening by looking at the output of EXPLAIN, and report the problem to me if you find out otherwise. -- D. Richard Hipp d...@sqlite.org _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users