Skip to content

Performance based Adaptive Warehouse switching #3

@algorithmor

Description

@algorithmor

Query SLAs matter a lot and Snowflake's main advantage is that we can improve performance for a query by increasing warehouse size

  • Log query execution times with min, avg, max time statistics for warehouse sizes

  • Default warehouse size for executing the query is XS always

  • If user has specified a particular warehouse size then that warehouse size will be used to
    execute the query

  • A new boolean column "scalable" will be introduced to the data model to determine if the report query is to be configured to autoscale if needed

  • While executing a report query, the service layer will try to execute it on the smallest warehouse size where SLA < MIN ( max_time , Query_Timeout (if configured) )

  • If the report query has no history for certain other warehouse sizes, then in case of query timeout on the expected warehouse or timeout, the warehouse sizes will be increase exponentially.
    e.g. The configured warehouse configured for the report is WH_XS
    SLA = 15 seconds & WH_XS STATEMENT_TIMEOUT_IN_SECONDS = 20 seconds
    In this case, the query should get killed after 15 seconds if not complete and then retried with size S warehouse and if it fails there too, then jump exponentially to size M

  • TODO Add query kill option after SLA exceeded by setting Session STATEMENT_TIMEOUT_IN_SECONDS parameter. NOTE : This value will be overwritten if the same parameter is set at another level with a lower value.
    https://community.snowflake.com/s/article/faq-how-can-i-override-the-statementtimeoutinseconds-parameter-at-the-warehouse-level

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions