[Groonga-mysql-commit] mroonga/mroonga [master] #1072 more efficiency

Back to archive index

null+****@clear***** null+****@clear*****
2011年 9月 11日 (日) 18:09:46 JST


Kentoku	2011-09-11 09:09:46 +0000 (Sun, 11 Sep 2011)

  New Revision: 17b4b9ca79bb08087b26576588ae02d644ce72df

  Log:
    #1072 more efficiency

  Modified files:
    ha_mroonga.cc

  Modified: ha_mroonga.cc (+9 -17)
===================================================================
--- ha_mroonga.cc    2011-09-11 03:45:44 +0000 (71e183c)
+++ ha_mroonga.cc    2011-09-11 09:09:46 +0000 (dd2454f)
@@ -4862,27 +4862,19 @@ void ha_mroonga::store_fields_from_primary_table(uchar *buf, grn_id record_id)
   int n_columns = table->s->fields;
   for (i = 0; i < n_columns; i++) {
     Field *field = table->field[i];
-    const char *col_name = field->field_name;
-    int col_name_size = strlen(col_name);
 
-    bool need_store_field = true;
-    if (ignoring_no_key_columns) {
-      need_store_field = false;
-      uint n_keys = table->s->keys;
-      for (uint j = 0; j < n_keys; j++) {
-        KEY key_info = table->s->key_info[j];
-        if (strcmp(key_info.key_part[0].field->field_name, col_name) == 0) {
-          need_store_field = true;
-          break;
+    if (bitmap_is_set(table->read_set, field->field_index) ||
+        bitmap_is_set(table->write_set, field->field_index)) {
+      const char *col_name = field->field_name;
+      int col_name_size = strlen(col_name);
+
+      if (ignoring_no_key_columns) {
+        KEY key_info = table->s->key_info[active_index];
+        if (strcmp(key_info.key_part[0].field->field_name, col_name)) {
+          continue;
         }
       }
-    }
-    if (!need_store_field) {
-      continue;
-    }
 
-    if (bitmap_is_set(table->read_set, field->field_index) ||
-        bitmap_is_set(table->write_set, field->field_index)) {
 #ifndef DBUG_OFF
       my_bitmap_map *tmp_map = dbug_tmp_use_all_columns(table,
                                                         table->write_set);




Groonga-mysql-commit メーリングリストの案内
Back to archive index