django-redshift-backend
django-redshift-backend copied to clipboard
Support query_group for WLM
Subject: Set query_group
for WLM
Feature or Bugfix
- Feature
- ~~Bugfix~~
Purpose
- Set
query_group
when create connection
Detail
- Run
SET query_group TO <specific query group by OPTIONS>
Relates
- https://docs.aws.amazon.com/redshift/latest/dg/cm-c-implementing-workload-management.html
- https://docs.aws.amazon.com/redshift/latest/dg/r_query_group.html
(It's my first Draft pull request! If this become a non-draft PR, I should review it.)
I'll testing on my application :)
Check on my application
-
My settings
'OPTIONS': {'query_group': 'report'}
-
Check queries are labeled to 'report' in
svl_qlog
select query, pid, substring, elapsed, label from svl_qlog where label ='report' order by query; query | pid | substring | elapsed | label ---------+-------+--------------------------------------------------------------+---------+-------------------------------- 7964883 | 11061 | ************************************************************ | 2189779 | report 7964910 | 11826 | ************************************************************ | 63912 | report 7964916 | 11848 | ************************************************************ | 29222 | report 7964917 | 11847 | ************************************************************ | 128189 | report 7964926 | 11901 | ************************************************************ | 50180 | report 7964927 | 11902 | ************************************************************ | 95262 | report 7964930 | 11907 | ************************************************************ | 56460 | report 7964931 | 11908 | ************************************************************ | 2937231 | report 7964932 | 11927 | ************************************************************ | 7731372 | report 7964933 | 11929 | ************************************************************ | 7613961 | report (10 rows)
Raw SQLs (
substring
) are masked :)
Its works fine for me.
My application using new query group :)
@shimizukawa This PR is ready fore review. Please review it.
@shimizukawa Thank you for your review. I'll fix it :)
@Surgo how about this?
@shimizukawa I'm sorry but to busy now... I'll fix within weeks..
OK, no problem. It's just a reminder :)