Archives of the TeradataForum
Message Posted: Wed, 18 Aug 2004 @ 18:23:01 GMT
Subj: | | Re: Different plans for the same SQL request |
|
From: | | Fred Pluebell |
Possibilities for real differences in query plans (not just formatting) between EXPLAIN and what is already executing:
1) Something changed between the time the executing query was optimized and the time of the EXPLAIN, e.g. index built, updated stats
collected.
2) The SQL isn't really the same; for example, EXPLAIN supplies literal values in the WHERE clause but the real query has parameter
markers or host variables. (If the actual values are known at optimization time, the optimizer can generate an "aggressive" query plan; otherwise
it may focus on minimizing worst case.)
|