Ryan Johnson <ryan.john...@cs.utoronto.ca> wrote:
> I'd go for a user-defined aggregate taking two args: the key (to
> identify "first") and the value to coalesce. Sure, it would never stop
> the scan early, but the benefit of doing one scan instead of five
> probability outweighs that (unless Steinar has an appropriate index on
> every single column, which I doubt).

Or unless a non-null value is typically found in the first few rows of a large 
table. In other words, if the ratio of nulls to non-nulls is small (and if it's 
large, then I'd be thinking of a different schema, one that represents a sparse 
table more efficiently).
-- 
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to