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


Please Help Members By Posting Answers For Below Questions

If a Node is busy what are the steps you can take to avoid ?

1861


What are differences between teradata and ansi session modes in teradata?

611


How will you solve the problem that occurs during update?

568


Mention a few of the ETL tools that come under Teradata.

602


My table got locked during mload due to a failed job. What do I do to perform other operations on it?

662






Can you fastexport a field, which is primary key by putting equality on that key?

696


How many codd's rules are satisfied by teradata database?

651


What is stored procedure in teradata?

572


How to Extract data from multiple legacy systems?

561


What are the different softwares used with their functions in teradata?

563


Define views in teradata with syntax.

625


What are the different functions performed in development phase?

556


What are some commonly used bteq scripts?

555


What are some primary characteristics of teradata?

533


What is spool space? Why do you get spool space errors? How do trouble-shoot them?

521