I have two queries running on Amazon RedShift database. Both the queries are exactly same except the tables that they are referring to. The tables are different in terms of their distribution styles and sort keys.
It is a simple join operation.
Let me call the two queries as Q1 and Q2. When I view the query plan using EXPLAIN, their plans are similar except following two differences.
Q1: DS_BCAST_INNER and cost is also estimated to be way higher. Q2: DS_DIST_NONE and cost is much smaller than Q1
However, to my surprise, execution time for Q2 is coming out to be higher than Q1. Any ideas??