[TiDB docs]: ordering by the wrong distance function gives the warning ANN index not used: not ordering by COSINE distance. Ordering DESC gives ANN index not used: index can be used only when ordering by vec_cosine_distance() in ASC order. The planner only accepts ascending order, a single ORDER BY item, TopN directly above the DataSource, and no pushed-down filters: a WHERE pre-filter defeats the index. Analyze performance with EXPLAIN ANALYZE and the vector_idx execution info, which shows load, search, and read breakdowns.

Context: When the vector index cannot be used, TiDB emits a warning naming the cause. Check warnings right after EXPLAIN.