Create optimization task (synchronous)
Creates a SQL optimization task and waits synchronously for the optimization to complete before returning the result. Suitable for short queries or scenarios where the client can wait for a long time.
If optimization takes a long time (exceeding the HTTP timeout), use the asynchronous endpoint /createAnalysisAsync instead.
Default value priority
Request parameters > user configuration (UserConfig) > global configuration (PawsqlConfig) > system hardcoded defaults
Hardcoded defaults: analyzeFlag=true, closeRewrite=true, deduplicateFlag=false,
indexOnly=false, maxMembers=3, maxMembersForIndexOnly=2, maxPerTable=2, maxSpace=1
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