Use stack memory for queries unless there are a lot of params.