Skip to main content
Apache Pinot supports three types of query-level quotas that work together in a hierarchical system to control query rates and prevent resource exhaustion.

Overview of Quota Types

The three quota types are enforced in hierarchical order, with the most restrictive (lowest QPS) quota taking precedence

1. Table-Level Quotas

Table quotas limit QPS for specific tables and have the highest precedence in the hierarchy. This can be specified in the table config as shown in this example:
{
  "tableName": "pinotTable",
  "tableType": "OFFLINE",
  "quota": {
    "maxQueriesPerSecond": 300
  },
  ...
}

2. Database-Level Quotas

Database quotas apply to all tables within a specific database and are checked before table quotas. This is typically set in the cluster config as shown below:
curl -X POST \
  'http://localhost:9000/cluster/configs' \
  -d '{
    "databaseMaxQueriesPerSecond" : "1000"
  }'
This can also be set using the database API
# to set database specific quota
curl -X POST 'http://localhost:9000/databases/{databaseName}/quotas?maxQueriesPerSecond=1200'

3. Application-Level Quotas

Application quotas limit QPS based on the application identifier passed in query options. This can be set in the cluster config as shown below:
curl -X POST \
  'http://localhost:9000/cluster/configs' \
  -d '{
    "applicationMaxQueriesPerSecond" : "1000"
  }'
You could also use the API directly:
# to set application's quota
curl -X POST 'http://localhost:9000/applicationQuotas/{applicationName}?maxQueriesPerSecond=1200'
In case of application specific quota, you do need to specify the application name in the query as shown:
set applicationName='test';
select * from tables
For more details on the syntax, how they’re imposed - please refer to the Apache Pinot documentation page that describes this in detail: Query Quotas

Example Scenarios

Table QuotaDatabase QuotaApplication QuotaEffective LimitReason
10 QPS25 QPS50 QPS10 QPSTable quota is lowest
30 QPS15 QPS50 QPS15 QPSDatabase quota is lowest
30 QPS25 QPS5 QPS5 QPSApplication quota is lowest
Not set25 QPS50 QPS25 QPSDatabase quota applies