If work_mem is set at user level by using below statement, assume this gets applied to each query run by this user?
alter user user1 set work_mem='64MB';
- If a function is executed with security definer - will it run with user1's work_mem or the work_mem of function owner?
- If a function is executed with security invoker and there is a work_mem set to say 1GB - will it run with user1's work_mem or the work_mem set in the function?
- If user1 is executing multiple sessions, does each session get its own 64MB memory or use one chunk of 64MB set at user level?
The idea here is to give certain users more memory.