Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SQL Anywhere 10.0.1 » SQL Anywhere Server - SQL Usage » Query Optimization and Execution » How the optimizer works

Updating column statistics Next Page

Automatic performance tuning


One of the most common constraints in a query is equality with a column value. The following example tests for equality of the Sex column.

SELECT *
FROM Employees
WHERE Sex = 'f';

Queries often optimize differently at the second execution. For the above type of constraint, SQL Anywhere learns from experience, automatically allowing for columns that have an unusual distribution of values. The database stores this information permanently unless you explicitly delete it using the DROP STATISTICS command. Note that subsequent queries with predicates over that column may cause the database server to recreate a histogram on the column. See Updating column statistics.