If you do the first query without whitespaces and the second with whitespaces you'll see, that the second is still faster....
The reason are cached datablocks....
Thanks Roger for your quick reply to my question.
Please can you explain me in detail what is meant by cached datablocks? Its becuase of whitespaces? and more cached datablocks means slow execution ?
1 person found this helpful
Almost all computers use disks for storage, with a relatively little bit of RAM storage, which is much faster.
Oracle keeps (or caches ) some of the most recently used data in RAM, so if you need to read the same data over and over (e.g., you're doing several related queries) it can use the faster RAM, so the 1st time you use that data, you have to use the relatively slow disk, but the 2nd time you can use the much faster RAM.
Roger suggests that this is what you are noticing. It has nothing to do with whitespace. That is, Roger is guessing (which is the best anybody can do with what you've posted so far) that you're running essentially the same query 2 times, and whichever version you run 1st will be slower than whichever version you run 2nd, because when you do the 2nd query, some of the data you need will be cahched in the much faster RAM.
Thanks Frank for your detail explanation.