Skip to main content

SET ENGINE

Specify the engine that will be used to execute subsequent queries in the current session.

When a session engine is set, it overrides Workload Management (WLM) routing rules. The setting remains active until the session ends or until it is explicitly reset using RESET ENGINE. Changing the session engine does not persist across sessions.

Syntax
SET ENGINE <engine_name>

Parameters

<engine_name> String

Specifies the compute engine to use for executing subsequent queries in the session. The engine must be available, and the user must have the USAGE privilege on it. By default, all users have USAGE on all engines. Use the CURRENT_ENGINE() function to return the name of the engine currently in use for the active session.

Examples

Run subsequent queries in the same session on the specified engine
SET ENGINE first_engine;

SELECT CURRENT_ENGINE();