| Option | AdHocTablesLimit | |
| Description | Maximum number of ad hoc tables that can be created. Limits the total number of ad hoc query result tables that can exist in the system at one time. | |
| Introduced Version | 1.163.0 | |
| Default | 10 | |
| Minimum | 0 | |
| Maximum | 20 | |
Ad hoc tables are in-memory tables generated by the
defineTable() function. Adjusting this
limit allows you to balance between providing flexibility for
complex queries with multiple ad hoc tables while preventing
excessive resource usage from too many in-memory tables.
Tables are automatically cleaned up when the creating query completes or the session expires.
This setting works in conjunction with:
AGGREGATOR_OUTPUT_ROW_LIMIT- limits rows per aggregate operationEXACT_MATCH_LIMIT- controls memory usage for exact matchesCORRELATE_QUERY_LIMIT- limits correlation queries that may create tables
When running complex queries with correlations or multiple aggregations, consider the cumulative memory impact of all of the above limits together.
Increase the limit if users frequently encounter "limit exceeded" errors. Decrease if experiencing memory pressure or OutOfMemoryError exceptions during complex queries with multiple ad hoc tables.
When the limit is reached, attempts to create additional ad hoc
tables via defineTable() will fail with an
error message: "Ad hoc table limit exceeded (X/Y tables in
use)". The query will terminate with an error status. Existing
ad hoc tables remain unaffected and continue to function
normally until they are automatically cleaned up or the query
session ends.
Warning logs, such as "Ad hoc table usage high: 8/10 tables in use", are generated at 80% capacity. When troubleshooting limit-related query failures, search the system repositories for "ad hoc table limit" messages.