Performance: Subquery or Joining

Posted by Auro on Stack Overflow See other posts from Stack Overflow or by Auro
Published on 2010-05-20T06:54:53Z Indexed on 2010/05/20 7:10 UTC
Read the original article Hit count: 135

Filed under:
|

Hello

I got a little question about performance of a subquery / joining another table

INSERT
INTO Original.Person
  (
    PID, Name, Surname, SID
  )
  (
    SELECT ma.PID_new , TBL.Name , ma.Surname, TBL.SID 
    FROM Copy.Person TBL , original.MATabelle MA
    WHERE TBL.PID         = p_PID_old
      AND TBL.PID         = MA.PID_old
  );

This is my SQL, now this thing runs around 1 million times or more.
Now my question is what would be faster?

if I change TBL.SID to (Select new from helptable where old = tbl.sid)
or if I add helptable to the from and do the joining in the where?

greets
Auro

© Stack Overflow or respective owner

Related posts about Oracle

Related posts about sql