Advanced query options
Learn how to use advanced query options.
The following options are available in the query editor's Advanced tab. Many query options can help you improve your app's performance. Read about best practices to learn how to optimize queries.
Hide parameters from audit logs
Queries and their parameters are logged in the audit logs when they're run. You should hide sensitive parameters, such as API keys, from your audit logs. Add sensitive parameters to the Disable logging for field on the Advanced tab in the query editor. In the audit logs, these parameter values display as --blacklisted-by-developer--
.
Query throttling
If app performance is slow, it might be because your queries are refreshing too frequently (e.g., on every keystroke). To solve this, you can throttle queries so they runs less frequently. The default is 750ms
.
Query timeout
Retool automatically times out queries that run for longer than 10 seconds (10000ms
). You can adjust the Timeout after duration for queries on an individual basis in the Advanced tab of the query editor. For Retool-hosted users, the maximum duration before a query times out is 120 seconds (120000ms
). Self-hosted users can set the DBCONNECTOR_QUERY_TIMEOUT_MS
environment variable to change the maximum timeout value.
Configure query-specific notifications
There are a few notification settings you can set at the global level, but you can also configure notification settings on individual queries. This includes toggling success and failure notifications, but also duration and success messages. You configure these settings from the Response tab after selecting a query.
Keep variable references in sync
This setting may introduce performance issues and may not work well with transformers, so use it with caution.
If your query calls a component's setValue
method, you can ensure future references to the component use the updated value by toggling on the Keep variable references inside the query with your app setting. This can be useful if you need to set and use a value in the same query.