Skip to main content
Version: I2023.4.1

SQL Hints to Control the Use and Generation of Aggregate Tables

There are two SQL hints that you can insert into SQL statements to control both whether the AtScale engine will use an aggregate to satisfy a query, and whether the AtScale engine will generate an aggregate that is based on a query.

In an SQL statement that you run from any client in which you can edit statements directly before passing them to AtScale, place one or both of these hints in SQL comments:

use_aggs(false)
Prevents the AtScale engine from instructing query engines to satisfy the query with an aggregate table. Neither system-defined nor user-defined aggregate tables will be used.

generate_aggs(false)
Prevents the AtScale engine from generating an aggregate table to satisfy this query in the future and similar queries that might be run in the future.

Here is an example of an SQL statement that uses both hints: :

SELECT
/* use_aggs(false) */
/* generate_aggs(false) */
`order quantity`,
`city`
FROM
`devschema`.`dave_default`
GROUP BY
`city`

More information

Types of Aggregate Tables in AtScale

When the AtScale Engine Creates Demand-Defined Aggregates