We are seeing a very weird condition in the Oracle query. The below query,
SELECT e.C1, MAX (e.Some)
FROM MyTable e
WHERE e.Code = :Code
GROUP BY E.C1
ORDER BY MAX (e.Some)
Note the table contains around 5 million records and Code is a primary key.
On the first attempt, it returns the value in 60/70 second but after that, it returns the result in 500 milliseconds.
Is there any parameter sniffing in Oracle or can we have OPTION(RECOMPILE) in Oracle?