Review these tips and make adjustments to increase your Presto queries performance.

  • Always use TD_TIME_RANGE or TD_INTERVAL (with a link to Scheduling Presto Queries)

  • Avoid using slow memory consuming operators such as

    • ORDER BY

    • COUNT(DISTINCT x)

For example, instead of using COUNT (DISTINCT x), use approx_distinct(x).

  • Join processing

    • Tables should be joined in the order of a larger table to smaller tables.

    • Using a non-equi join condition slows down the query processing.

  • Columnar storage characteristics

    • Choosing too many columns slows down query processing.

  • Query result size

    • Generating too many rows takes time. Instead, use CREATE TABLE AS … or INSERT INTO or result_redirect magic comment.

  • No labels