Check to make sure mem is less than con, set work_mem to 1 otherwise.
Merge pull request #188 from hw-cookbooks/work_mem

Check to make sure mem is less than con, set work_mem to 1 otherwise.