Chapter 5 – Tera-Tom’s Top Tips

“Let me once again explain the rules. Tera-Tom Rules!”

-Tera-Tom fan

Tera-Tom's Top Tips

1. When given a choice between using a join or a subquery, usethe join.

2. Change your expression's subselects by moving the subselect from the WHERE clause to the FROM clause or by rewriting it as a join.

3. Use an inner subquery to shrink the size of data on which outer queries needs to operate. Likewise, use an inner subquery to shrink the size of a relation before the data is redistributed on a different distribution key.

4. Avoid per-row functions or delay them. Group rows first, and then apply the function.

5. Avoid doing JOINs, GROUP BYs, and WHERE clauses on data types that are non-native.

6. EXPLAIN should be used ...

Get Aster Data SQL and MapReduce now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.