About

The optimizer considers possible query plans for a given query, and attempts to determine which of those plans will be the most efficient (or, more usually, "efficient enough"). Statistics about data in tables accessed by the query can be used to determine things such as join type, index usage, etc. Information available to the optimizer may include estimated number of rows in the table, the range and distribution of values in each column, and details about the operating environment (such as disk speed, and memory available).

For more details, see the Wikipedia article.

history | show excerpt | excerpt history