in reply to Fast Building of SQL Statements

However, map still scales linearly, so this will be slow on large tables or when calling the subroutine sequentially.

The relative performance of map in this regard is barely measurable in comparison with the time it takes to execute the query.

I think you're micro-optimizing in the wrong place.