Performance: Subquery or Joining
- by Auro
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