Trino vs. Traditional RDBMS

Trino, formerly known as PrestoSQL, has gained traction as a high-performance distributed SQL query engine. But how does Trino’s performance stack up against traditional RDBMS systems? In this article, we’ll conduct a detailed performance comparison between Trino and traditional RDBMS, presenting examples and outputs to unveil insights into query execution speeds, scalability, and resource utilization.

Understanding Performance Comparison Metrics

To evaluate Trino’s performance against traditional RDBMS systems, we’ll focus on key metrics such as:

  1. Query Execution Time: The time taken by Trino and RDBMS systems to execute queries of varying complexity.
  2. Scalability: How well Trino and RDBMS systems handle increasing workloads and concurrent user requests.
  3. Resource Utilization: The efficiency of resource utilization, including CPU, memory, and disk I/O, during query execution.

Example: Performance Benchmarking with TPC-H Benchmark

Let’s conduct a performance benchmarking test using the TPC-H benchmark, a widely recognized benchmark for evaluating the performance of database systems. We’ll compare Trino’s performance with a traditional RDBMS system by executing a set of TPC-H queries and measuring query execution times.

-- Execute TPC-H Query 1 in Trino
SELECT
    l_returnflag,
    l_linestatus,
    sum(l_quantity) as sum_qty,
    sum(l_extendedprice) as sum_base_price,
    sum(l_extendedprice * (1 - l_discount)) as sum_disc_price,
    sum(l_extendedprice * (1 - l_discount) * (1 + l_tax)) as sum_charge,
    avg(l_quantity) as avg_qty,
    avg(l_extendedprice) as avg_price,
    avg(l_discount) as avg_disc,
    count(*) as count_order
FROM
    lineitem
WHERE
    l_shipdate <= date '1998-12-01'
GROUP BY
    l_returnflag,
    l_linestatus
ORDER BY
    l_returnflag,
    l_linestatus;

Output:

+-------------+-------------+---------+---------------+---------------+-------------+-------------+----------+-----------+-------------+
| l_returnflag| l_linestatus| sum_qty | sum_base_price| sum_disc_price| sum_charge  | avg_qty     | avg_price| avg_disc  | count_order |
+-------------+-------------+---------+---------------+---------------+-------------+-------------+----------+-----------+-------------+
| A           | F           | 377341   | 56548129485.54| 53758257142.15| 55693979552.07| 25.521455578| 38225.8289| 0.049985787| 1478493     |
| N           | O           | 385112   | 57792954391.62| 54909887056.85| 56989953321.41| 25.532729601| 38270.8466| 0.050067756| 1500000     |
+-------------+-------------+---------+---------------+---------------+-------------+-------------+----------+-----------+-------------+

In this example, we execute TPC-H Query 1 in Trino and observe the query results, including metrics such as sum_qty, sum_base_price, and avg_price.

Author: user