django-redshift-backend icon indicating copy to clipboard operation
django-redshift-backend copied to clipboard

Support query_group for WLM

Open Surgo opened this issue 6 years ago • 8 comments

Subject: Set query_group for WLM

Feature or Bugfix

  • Feature
  • ~~Bugfix~~

Purpose

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

Surgo avatar Feb 19 '19 12:02 Surgo

(It's my first Draft pull request! If this become a non-draft PR, I should review it.)

shimizukawa avatar Feb 19 '19 14:02 shimizukawa

I'll testing on my application :)

Surgo avatar Feb 20 '19 04:02 Surgo

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.

Surgo avatar Feb 20 '19 08:02 Surgo

My application using new query group :)

screenshot 2019-02-20 19 20 33

@shimizukawa This PR is ready fore review. Please review it.

Surgo avatar Feb 20 '19 10:02 Surgo

@shimizukawa Thank you for your review. I'll fix it :)

Surgo avatar Feb 26 '19 09:02 Surgo

@Surgo how about this?

shimizukawa avatar Mar 17 '19 04:03 shimizukawa

@shimizukawa I'm sorry but to busy now... I'll fix within weeks..

Surgo avatar Mar 18 '19 02:03 Surgo

OK, no problem. It's just a reminder :)

shimizukawa avatar Mar 18 '19 12:03 shimizukawa