sel a.t1,b.t1 from emp a left outer join dept b ON
a.id=b.id where b.deptno=10;
sel a.t1,b.t1 from emp a left outer join dept b ON
a.id=b.id and b.deptno=10;
what is the difference on the above 2 queries?
Answer Posted / tdguy
This is a good question. If we look at the explain plans,we
would be able to understand the difference.
1. In the first query, the condition given in where clause
is applied after the left outer join process on the tables.
This means that it is a plain left outer jon on id column
between the tables and the where condition is applied after
the join process. This can be seen in the explain plan as
"by way of a RowHash match scan with a condition".
2. In the second query, the condition given in and
statement clause is applied along with the left outer join
process on the tables. This means that it is a left outer
jon on id column between the tables with table b with only
one row. This can be seen in the explain plan as
"by way of a RowHash match scan with no residual conditions
".
| Is This Answer Correct ? | 8 Yes | 0 No |
Post New Answer View All Answers
Highlight the need for Performance Tuning.
Difference between inner join and outer join?
What does Amp contain and what are all the operations that it performs?
Mention a few of the ETL tools that come under Teradata.
Steps to create a data model?
Explain the meaning of Amp?
Give the sizes of SMALLINT, BYTEINT and INTEGER.
What are the different softwares used with their functions in teradata?
My table got locked during mload due to a failed job. What do I do to perform other operations on it?
Can we collect statistics on multiple columns?
why use references rather than pointers in the public api, particularly for arguments which are modified?
What is primary index and secondary index?
Explain amp in teradata?
What are the components used in smp and massively parallel processing (mpp) machines?
What is the difference between teradata and oracle?