• Yuchen Pei's avatar
    MDEV-27419 [demo/check-ci] choose desc key for desc ordering · cdeaefee
    Yuchen Pei authored
    A key may be chosen in test_if_skip_sort_order(), after calling
    test_if_cheaper_ordering(). The latter iterates over the keys, and
    call test_if_order_by_key() to determine whether the key can be used
    in ORDER BY.
    
    We make it so that if the result of test_if_order_by_key() indicates
    the current key under consideration would result in a better matching
    ordering (e.g. ORDER BY DESC matches a desc key better than an asc
    key), then we choose that key, given that the range_cost is the same.
    
    TODO: consider whether it is possible to quantify the order matching
    by passing direction to get_range_limit_read_cost.
    cdeaefee
mdev_27419.result 603 Bytes