Create optimization task (asynchronous)
Creates a SQL optimization task and returns immediately, polling for results via /getAnalysisSummary.
Suitable for long queries or scenarios where HTTP timeouts should be avoided.
Authorizations
Activation code, obtained via the /getUserKey endpoint
Body
Create optimization task request
Activation code
"CB698418-88B25371-67F15F01-XXXXXXXX"
Workspace ID or DDL text (an offline workspace is auto-created when DDL is passed)
SQL text to optimize
SQL type: plain_sql / mysql_query_log / postgresql_query_log
plain_sql, mysql_query_log, postgresql_query_log "plain_sql"
Database type (displayCode); required when workspace is DDL, default mysql. See the dbType table in the /createWorkspace endpoint for supported values.
Whether to run validate checks (only effective for online workspaces), default false
Whether to validate as a single SQL statement only
Optimization task name; auto-generated when omitted
Whether to run analysis
Whether to disable query rewriting
Whether to deduplicate indexes
Whether to update statistics before validation
Whether to recommend indexes only (no rewriting)
Maximum number of columns in a composite index
Maximum number of columns in a composite index in index-only mode
Maximum number of recommended indexes per table
Maximum index space multiplier
Custom rule list; the default audit rules are used when omitted