BlogsShopifyTrino Query Execution Performance Tooling

Trino Query Execution Performance Tooling

Trino Query Execution Performance Tooling

1
posts
2021

This feature thread tracks the development and enhancement of Shopify's Trino query execution performance. Initial efforts focused on speeding up query execution time to meet the goal of p95 query results in five seconds or less. This involved tuning infrastructure and addressing the risks associated with changes. The development of custom verification, benchmarking, and profiling tooling was initiated to minimize the risk of various changes at scale. This tooling, built as a lightweight Python library, aims to extract undocumented tribal knowledge into code, providing familiar interfaces for different testing needs. The verification component leverages PyTest fixtures for structured unit testing of Trino clusters, allowing for correctness and performance assertions. The benchmarking component utilizes TPC-DS queries on sample datasets with varying scale factors to evaluate performance under standardized conditions. The profiling aspect is intended to provide deeper insights into query execution.

2021

Shopify's Path to a Faster Trino Query Execution: Custom Verification, Benchmarking, and Profiling Tooling - Shopify

10/27/2021

This post details the development of custom verification, benchmarking, and profiling tooling for Trino at Shopify. The tooling is a lightweight Python library designed to minimize the risk of changes to the Trino cluster. The verification component uses PyTest fixtures to run unit tests, including correctness checks (exact row matching) and performance assertions (threshold comparisons on execution time). It supports running queries on single candidate clusters and comparing results against standby control clusters. The benchmarking component uses TPC-DS queries with varying scale factors to evaluate performance under standardized conditions. The post also outlines the problem of managing Trino forks and the need for a structured vetting process, drawing an analogy to Formula 1 race car simulators.