Is is faster to filter and get data or filter then get data ?
- by remi bourgarel
Hi
I have this kind of request :
SELECT myTable.ID,
myTable.Adress,
-- 20 more columns of all kind of type
FROM myTable
WHERE EXISTS(SELECT * FROM myLink
WHERE myLink.FID = myTable.ID
and myLink.FID2 = 666)
myLink has a lot of rows.
Do you think it's faster to do like this :
SELECT myLink.FID INTO @result
FROM myLink
WHERE myLink.FID2 = 666
UPDATE @result SET Adress = myTable.Adress,
-- 20 more columns of all kind of type
FROM myTable
WHERE myTable.ID = @result.ID