[Groonga-mysql-commit] mroonga/mroonga at ef0e2dc [master] add count skip optimization for wrapper mode. refs #1841

Back to archive index

Kentoku null+****@clear*****
Tue Jul 16 03:00:25 JST 2013


Kentoku	2013-07-16 03:00:25 +0900 (Tue, 16 Jul 2013)

  New Revision: ef0e2dc84be3e230437677cd4e9a7d5b63f87c5e
  https://github.com/mroonga/mroonga/commit/ef0e2dc84be3e230437677cd4e9a7d5b63f87c5e

  Message:
    add count skip optimization for wrapper mode. refs #1841

  Modified files:
    ha_mroonga.cpp

  Modified: ha_mroonga.cpp (+20 -0)
===================================================================
--- ha_mroonga.cpp    2013-07-12 15:03:54 +0900 (0a1ae91)
+++ ha_mroonga.cpp    2013-07-16 03:00:25 +0900 (3804435)
@@ -8923,6 +8923,16 @@ int ha_mroonga::wrapper_get_next_record(uchar *buf)
         key_length = grn_table_cursor_get_key(ctx, cursor, &key);
         GRN_TEXT_SET(ctx, &key_buffer, key, key_length);
       }
+      if (count_skip) {
+        DBUG_PRINT("info", ("mroonga: count_skip: TRUE"));
+        if (record_id == GRN_ID_NIL) {
+          record_id = found_record_id;
+        } else {
+          error = 0;
+          table->status = 0;
+          break;
+        }
+      }
     } else {
       error = HA_ERR_END_OF_FILE;
       break;
@@ -9186,10 +9196,20 @@ void ha_mroonga::check_count_skip(key_part_map start_key_part_map,
         count_skip = false;
         DBUG_VOID_RETURN;
       }
+      if (share->wrapper_mode &&
+          !(wrap_handler->ha_table_flags() & HA_NO_TRANSACTIONS)) {
+        DBUG_PRINT("info", ("mroonga: count skip: transactional wrapper mode"));
+        count_skip = false;
+        DBUG_VOID_RETURN;
+      }
       DBUG_PRINT("info", ("mroonga: count skip: skip enabled"));
       count_skip = true;
       mrn_count_skip++;
       DBUG_VOID_RETURN;
+    } else if (share->wrapper_mode) {
+      DBUG_PRINT("info", ("mroonga: count skip: wrapper mode"));
+      count_skip = false;
+      DBUG_VOID_RETURN;
     } else {
       DBUG_PRINT("info", ("mroonga: count skip: without fulltext"));
       uint key_nr = active_index;
-------------- next part --------------
HTML����������������������������...
Download 



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