Does the optimizer treat a query differently when the object names in the query are fully qualified vs. when they are not fully qualified ?
I came across a query which gives one explain plan when the views referenced by the query are fully qualified i.e. <databasename>.<viewname>
and it generates an entirely different explain when the views are not fully qualified i.e., just the <viewname> with default database set to the desired <databasename>
Also, the query performance is much better with fully qualified names.
↧