We have just release our 9.3.5.S for public beta test. Together with the product, we released a benchmark based on TPCH. The modification to data types is easy to understand -- money and double types are faster than Numeric (and no one on this planet has a bank account that overflows the money type, not any time soon). The modifications to queries are more interesting.
We modified the queries not because we want to show off how fast Vitesse DB is. Without these modifications, some query will never finish. We have seen similar queries, and similar modifications required in the field. Overall, PostgreSQL is well capable of running the workload of TPCH as long as developers pay attention to some "tricks".
Now let's look at them,
Q2: The skeleton of Q2 look like
select xxx from t1, t2, ... where foo = (select min(bar) from tx, ty, .. where tx.field = t1.field ...);
This is correlated subquery (tx.field = t1.field) with aggregate. You can pull the subquery out with a join,
select xxx from t1, t2, ...
(select tx.field, min(bar) as min_bar from tx, ty ... group by tx.field) tmpt
where t1.field = tmpt.field and foo = min_bar ...
Performance of join (in this case, hash join, very fast) is two orders of magnitude faster than the subplan query.
Same trick is applied to Q17.
In the next post, I will examine Q20 which uses CTE (with clause).
We modified the queries not because we want to show off how fast Vitesse DB is. Without these modifications, some query will never finish. We have seen similar queries, and similar modifications required in the field. Overall, PostgreSQL is well capable of running the workload of TPCH as long as developers pay attention to some "tricks".
Now let's look at them,
Q2: The skeleton of Q2 look like
select xxx from t1, t2, ... where foo = (select min(bar) from tx, ty, .. where tx.field = t1.field ...);
This is correlated subquery (tx.field = t1.field) with aggregate. You can pull the subquery out with a join,
select xxx from t1, t2, ...
(select tx.field, min(bar) as min_bar from tx, ty ... group by tx.field) tmpt
where t1.field = tmpt.field and foo = min_bar ...
Performance of join (in this case, hash join, very fast) is two orders of magnitude faster than the subplan query.
Same trick is applied to Q17.
In the next post, I will examine Q20 which uses CTE (with clause).