Jens Alfke-2 wrote > First off, you didn’t register the function as deterministic, so SQLite > has to assume it can return a different result every time it’s called, > even with the same arguments. That immediately prevents the kind of > optimization you wanted.
I guess, it doesn't really matter whether function is deterministic or not. It is rather about how aliases should work. To prove it I have found "alias.test" in test folder. There is a comment: # Aliases are currently evaluated twice. We might try to change this # in the future. But not now. return The test is quite old, but still doesn't work. Moreover, consider query: SELECT x, rand() as random FROM tab WHERE random > 0.5; Currently, it would return random numbers which might be less than 0.5 due to two calls of rand(x). -- Sent from: http://sqlite.1065341.n5.nabble.com/ _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users