On Thu, Sep 15, 2011 at 8:08 AM, Igor Tandetnik <[email protected]> wrote:
> Richard Hipp <[email protected]> wrote: > > On Wed, Sep 14, 2011 at 9:03 PM, Sam Carleton < > [email protected]>wrote: > > > >> Forgive me, fore I have forgotten the term used to describe the behavior > if > >> a C if statement where it stops executing on the first false statement, > >> but... Does coalesce do that? > >> > > > > "Short-circuit evaluation" is the usual term applied to this kind of > thing, > > and yes, COALESCE() does short-circuit evaluation. If you say > > "coalesce(A,B)" and A is not NULL than B is never evaluated, which can be > a > > significant performance win if, for example, B is a complex subquery. > > When did this start, with what SQLite version? 3.6.21 - December 2009 > I must admit I'm somewhat behind (using 3.6.X for some X I don't recall at > the moment), but in the version I use, in expression coalesce(someField, > customFunction()) I definitely see customFunction() called even when > someField is not null. > -- > Igor Tandetnik > > _______________________________________________ > sqlite-users mailing list > [email protected] > http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users > -- D. Richard Hipp [email protected] _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

