This select's execution time is approximately 25 ~ 30 sec.
SELECT *
FROM custinfo cs
WHERE cs.idcust = (SELECT cust_id
FROM customers
WHERE id = 1230)
Execution plan for ' = ':
But if I change ' = ' for ' in ', then it becomes so much faster about 0.040 ~ 0.060-sec average.
SELECT *
FROM custinfo cs
WHERE cs.idcust in (SELECT cust_id
FROM customers
WHERE id = 1230)
Execution plan for ' in ':
And there have been opposite cases like this, where ' = ' was faster than ' in '.
Does anybody know the reason why simple syntax change makes this much difference in performance and execution time?
When is ' = ' is faster than ' in ' or vice versa? Are there some conditions for which to use in what cases?
- I'm using dblink for my table. Maybe that's what's affecting my query?
- Welp, guys, Here's the thing... Now both of my queries run for about ~0.10 sec. So now I can't find an Execution plan for my queries when they were running slow. And I have absolutely no idea why my queries performance changed in a day... Like, I can only guess the problem was with our servers, but, why did it only affect my 1 query, while the other runs normally? Still, here's my execution plans:
' = '



