Monday, November 7, 2022

How to make the session and user priority to increase in Redshift Database?

 user priority change:


The new priority to be assigned to all queries issued by user_name. 

This argument must be a string with the value CRITICAL, HIGHEST, HIGH, NORMAL, LOW, LOWEST, or RESET. 

Only superusers can change the priority to CRITICAL.


 Changing the priority to RESET removes the priority setting for user_name.


select change_user_priority('<username>','<Priority>');


select change_user_priority('user@abc.com','HIGHEST');



session priorty change:


CHANGE_SESSION_PRIORITY enables superusers to immediately change the priority of any session in the system. 

Only one session, user, or query can run with the priority CRITICAL.



returns the process identifier of the server process handling the current session.

select pg_backend_pid();

select change_session_priority(30311, 'Lowest');

               

 change_session_priority

---------------------------------------------------------

Succeeded to change session priority. Changed session (pid:30311) priority to lowest.

(1 row)

No comments:

Post a Comment