[Groonga-mysql-commit] mroonga/mroonga [master] Reduce scope

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Nov 16 16:21:19 JST 2012


Kouhei Sutou	2012-11-16 16:21:19 +0900 (Fri, 16 Nov 2012)

  New Revision: 1b779d2a8d0831d21b82b17b7b92d0aa93d6f95a
  https://github.com/mroonga/mroonga/commit/1b779d2a8d0831d21b82b17b7b92d0aa93d6f95a

  Log:
    Reduce scope

  Modified files:
    ha_mroonga.cpp

  Modified: ha_mroonga.cpp (+3 -2)
===================================================================
--- ha_mroonga.cpp    2012-11-16 16:17:30 +0900 (ab13fc4)
+++ ha_mroonga.cpp    2012-11-16 16:21:19 +0900 (7aa799b)
@@ -6105,8 +6105,6 @@ ha_rows ha_mroonga::storage_records_in_range(uint key_nr, key_range *range_min,
     } else {
       DBUG_PRINT("info", ("mroonga: use key%u", key_nr));
     }
-    uint table_size = grn_table_size(ctx, grn_table);
-    uint cardinality = grn_table_size(ctx, grn_index_tables[key_nr]);
     grn_table_cursor *cursor;
     grn_table_cursor *index_cursor;
 
@@ -6122,6 +6120,9 @@ ha_rows ha_mroonga::storage_records_in_range(uint key_nr, key_range *range_min,
     }
     grn_obj_unlink(ctx, index_cursor);
     grn_table_cursor_close(ctx, cursor);
+
+    uint table_size = grn_table_size(ctx, grn_table);
+    uint cardinality = grn_table_size(ctx, grn_index_tables[key_nr]);
     row_count = ceil((double)table_size * ((double)row_count / (double)cardinality));
   }
   DBUG_RETURN(row_count);
-------------- next part --------------
HTML����������������������������...
Download 



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