Resource queue not set the priority properly on segment and caused normal user unable to run query with MAX priority
search cancel

Resource queue not set the priority properly on segment and caused normal user unable to run query with MAX priority

book

Article ID: 296640

calendar_today

Updated On:

Products

VMware Tanzu Greenplum

Issue/Introduction

The issue can be observed on the Greenplum version prior to 6.17.0 (not including 6.17.0)

When the Greenplum database is set to using the resource queue to manage the workload, the user may observe that the query run by the normal account has much slower performance than executing by the super user. 

Noted that the super user has query priority set with MAX by default meanwhile normal user was set with MEDIUM. however, in the Greenplum version prior to 6.17, even we set the priority for the normal users to MAX, the performance is still slower than a superuser. if we look into the explain analyze output of the query, we can see:
  1. the query plan is the same
  2. the memory usage is the same
  3. all the operating nodes from the normal user are slower than the superuser, even the "seq scan", for example:
-- super user
->  Seq Scan on xxxx a  (cost=0.00..9611581.00 rows=21147527 width=22) (actual time=1.943..18747.917 rows=21232012 loops=1)

-- normal user
->  Seq Scan on xxxx a  (cost=0.00..9611581.00 rows=21147527 width=22) (actual time=1.271..45305.835 rows=21232012 loops=1)


Environment

Product Version: 6.12

Resolution

This is due to a known issue: https://github.com/greenplum-db/gpdb/pull/12011
it is due to the resource queue's CPU priority didn't take effect in segments

the issue has been fixed on Greenplum DB version 6.17 and afterward.
$ git tag --contain  3d4f553
6.17.0
6.17.1
6.17.2
6.17.3
...