Sei sulla pagina 1di 1

There are 2 tables, table A with 10 million records, table B has 100 million rec ords, now we are

joining both tables, when we seen Explain Plan the plan showing TD will took the table A and it will redistributes it. Now the Question is: By that plan is the optimizer is correct job or not ? Justi fy Ans There are 3 types of joining strategies: 1- duplicate all rows of one table onto every AMP (The duplication of all rows i s done when the non-PI column is on a small table), 2- redistribute the rows of one table by hashing the non-PI join column and send ing them to the AMP containing the matching PI row, 3- redistribute both tables by hashed join column value Now, in this case if the table A joining column is Non - PI then, TD redistribut es the rows by hashing the non-PI join column and sending them to the AMP contai ning the matching PI row of Table B. 2. From the same above example now the optimizer is taking Table B (100 million records) and it is distributing it, In this it might happen that the Joining column of Table B is Non - PI and that of Table A is PI, due to which it is trying to redistribute.

Potrebbero piacerti anche