How Resource Queues (RQ) Work in VMware Tanzu Greenplum (GPDB)
search cancel

How Resource Queues (RQ) Work in VMware Tanzu Greenplum (GPDB)

book

Article ID: 297016

calendar_today

Updated On:

Products

VMware Tanzu Greenplum

Issue/Introduction

The purpose of this document is to give a quick insight into how Resource Queue (RQ) works.

For detailed information on Resource Queues see Using Resource Queues in the documentation.

 

 

Environment

Product Version: All versions of Greenplum

Resolution

Resource Queue (RQ) Further Explained

Note: 

  • Any user with superuser privilege does not have RQ restrictions.
  • The amount of memory allowed for a session usage is the higher value between the statement_mem and RQ memory divided by RQ slots.
  • Based on cost, it is possible to categorise queries into two types where RQ is concerned, small queries and big queries.

  1. Small Query (Cost Of Query < min_cost)

  • If it is a small query, then it is not restricted by RQ attributes, and so the optimizer and GPDB engine will start executing immediately.
  • The idea of the small query is to not restrict queries below a certain cost and execute them fast enough. Consider more of OLTP (OnLine Transaction Processing) type queries as examples of small queries. 
  • This means that the min_cost value needs to be set appropriately low enough and not very high, otherwise many big queries will start going in the system without restriction. 
  • Any resource used by a small query does not count against RQ limits. For example, active_statements and the memory_limit are not counted against the RQ limit.

 2. Big Query (Cost of Query > min_cost)

  • These queries have to adhere to all the attributes of the RQ that is set. At that time, all the parameters except "Priority" are considered first for query submission and then execution.
  • The "Priority" attribute will be considered for the query being executed in the engine and the highest priority query will be given more resources. This means that the priority attribute is used for competing against queries of different RQs.
  • Reporting or warehousing queries are examples of big queries.

  RQ Flowchart