Search code examples
sqloracle-databasesqlperformance

Does Oracle hard parse a command again if aliases are changed?


If I execute a command like this:

select a.Id, b.Name from A b, B b where a.Id = b.Id

and then a second command like this, changing the aliases:

select c.Id, d.Name from A c, B d where c.Id = d.Id

There would be two hard parse operations? There is something like a parse cache? If yes, how does it work?


Solution

  • Oracle checks the checksum of your query and reparse the query if the checksum has been changed.

    So, yes it will reparse the query. Even if you will add/remove a whitespace, the checksum will change so Oracle will have to reparse it.