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:
- the query plan is the same
- the memory usage is the same
- 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)