Dmitri Kuzmenko пишет: > Ты лучше скажи, как там у вас с пересчетом селективности > индексов - когда она делается?
А зачем нужна селективность индексов если есть гистограммы распределения значений в полях? Статистика собирается и апдейтится обычно автоматически, но при необходимости есть возможность дропнуть ее: http://www.ianywhere.com/developer/product_manuals/sqlanywhere/0902/en/html/dbrfen9/00000405.htm или пересоздать: http://www.ianywhere.com/developer/product_manuals/sqlanywhere/0902/en/html/dbrfen9/00000374.htm А вот и "банальности" в общих словах про Optimizer estimates and histograms: http://www.ianywhere.com/developer/product_manuals/sqlanywhere/0902/en/html/dbugen9/00000392.htm Цитата оттуда: Adaptive Server Anywhere updates histograms as a by-product of query execution. As queries are executed, Adaptive Server Anywhere compares the number of rows estimated by the histograms for a given predicate with the number of rows actually found to satisfy the predicate, and then adjusts the values in the histogram to reduce the margin of error for subsequent optimizations. Этот процесс можно наблюдать, если интересно. Например дропнуть статистику, начать выполнять запросы с разными условиями и смотреть при этом как заполняется и уточняется статистика: http://www.ianywhere.com/developer/product_manuals/sqlanywhere/0902/en/html/dbrfen9/00000640.htm --~--~---------~--~----~------------~-------~--~----~ -~----------~----~----~----~------~----~------~--~---

