Hi Ayush,
The reason that your tablea is redistributed is because the join is on UPI and no index. TableA has a three columns NUPI, and in the join condition you are only using one column, so basically no index will be used. On the other hand, tableb has a UPI and thus the optimizer is trying to redistribute the rows according to the UPI table join column.
You can either revisit the NUPI column selections for tablea because that is hammering the execution plan, while you can probably make some other column of tableb which qualifies for the index value, and create a USI on tableb.cols1
↧