I'm curious to know what is the reason behind this issue -
I had a query for example
SELECT * FROM A WHERE A.DATE = (SELECT B.DATE FROM B)
Here B.DATE returned a single row and it's type is TIMESTAMP (3) while A.DATE is a DATE column.
So A table is huge but for one date it has only 100k rows. The above SQL took around 1000s to process.
When I did this it took only 10s -
SELECT * FROM A WHERE A.DATE = (SELECT CAST(B.DATE AS DATE) FROM B)
Can someone please explain why the CAST fixed the SQL run time?
Oracle Version - 19c