[Groonga-mysql-commit] mroonga/mroonga at 342c848 [master] mariadb10.1 storage: support index_flags() for ORDER BY DESC

Back to archive index

Kouhei Sutou null+****@clear*****
Tue Jun 16 22:43:35 JST 2015


Kouhei Sutou	2015-06-16 22:43:35 +0900 (Tue, 16 Jun 2015)

  New Revision: 342c848cac2ffcd688bdcea05ade8e470cb68c48
  https://github.com/mroonga/mroonga/commit/342c848cac2ffcd688bdcea05ade8e470cb68c48

  Message:
    mariadb10.1 storage: support index_flags() for ORDER BY DESC
    
    key::user_defined_key_parts is used as part. We may use the behavior for
    optimization in the future.

  Modified files:
    ha_mroonga.cpp

  Modified: ha_mroonga.cpp (+8 -0)
===================================================================
--- ha_mroonga.cpp    2015-06-16 22:22:22 +0900 (c391168)
+++ ha_mroonga.cpp    2015-06-16 22:43:35 +0900 (011daa0)
@@ -2683,6 +2683,14 @@ ulong ha_mroonga::storage_index_flags(uint idx, uint part, bool all_parts) const
       key->algorithm == HA_KEY_ALG_UNDEF) {
     flags = HA_READ_NEXT | HA_READ_PREV | HA_READ_RANGE;
     bool need_normalize_p = false;
+    // TODO: MariaDB 10.1 passes key->user_defined_key_parts as part
+    // for ORDER BY DESC. We just it fallback to part = 0. We may use
+    // it for optimization in the future.
+    //
+    // See also: test_if_order_by_key() in sql/sql_select.cc.
+    if (KEY_N_KEY_PARTS(key) == part) {
+      part = 0;
+    }
     Field *field = &(key->key_part[part].field[0]);
     if (field && should_normalize(field)) {
       need_normalize_p = true;
-------------- next part --------------
HTML����������������������������...
Download 



More information about the Groonga-mysql-commit mailing list
Back to archive index