Hi Andrey, the redistribution is usually based on the join columns, you can see the actual columns in EXPLAIN.
Rewriting the query might change the plan in some rare cases, e.g. if you join on a calculated column and put the calculation in a Derived Table. Usually collecting stats has more influence on the optimizer.
Thank you for help! Great, I can see the actual columns in EXPLAIN!
But the problem is that a query executes very slowly (exactly on this step, when JOIN and redistribution to all AMPs are performed) with a SKEW of 99%... Could you please tell me, what it means? And are there any ways to avoid such situations?