Why do Hash joins usually perform better than Merge Joins?
Answer / narayana
In MERGE join rows to be join must be present in same AMP.. If the rows to be joined are not on the same AMP, Teradata will either redistribute the data or duplicate the data in spool to make that happen based on row hash of the columns involved in the joins WHERE Clause.Hash join takes place if one or both of the tables on each can fit completely inside the AMP's memory.AMP chooses to hold small tables in its memory for joins happening on ROW hash.
Usually optimizer will first identify a smaller table, and then sort it by the join column row hash sequence. If the smaller table is really small and can fit in the memory, the performance will be best. Otherwise, the sorted smaller table will be duplicated to all the AMPs. Then the larger table is processed one row at a time by doing a binary search against the smaller table for matched record.
Where as in MERGE join Columns to be join is Non INDEXED column. teradata will redistribute the table rows into SPOOL memory and sort them by hash code.So that matching data lies on same amp, so the join can happen on redistributed data
| Is This Answer Correct ? | 6 Yes | 0 No |
What are the steps involved after the disk manager passes the request?
List the logical and conditional operators that are used with teradata along with their meanings?
What can be achieved by using the teradata rdbms?
Is PK concept available in Teradata. If it is how can we create Primary Key for a table in TD
Explain some differences between mpp and smp?
what is differences between Fastload and Multiload as per DBA aspect ?
Increasing no of amps will increase performance. Is this true?
one table have input no name 10 rao 20 siva 30 srinu 10 rao i want to ouput like this way no name 20 siva 30 srinu 10 rao how it posible in only sql server query?not oracle?
What are some primary characteristics of teradata?
How to cast date "2015-03-03-012204-000000" to timestamp
What do you mean by teradata intelliflex?
What is the command in bteq to check for session settings ?