[Groonga-commit] groonga/groonga at fb8d6f4 [master] select: support disabling AND match optimization by environment variable

Back to archive index

Kouhei Sutou null+****@clear*****
Fri Mar 24 13:03:03 JST 2017


Kouhei Sutou	2017-03-24 13:03:03 +0900 (Fri, 24 Mar 2017)

  New Revision: fb8d6f45725ba233460e3d6202648826568c17d2
  https://github.com/groonga/groonga/commit/fb8d6f45725ba233460e3d6202648826568c17d2

  Message:
    select: support disabling AND match optimization by environment variable
    
    You can disable by GRN_TABLE_SELECT_AND_MIN_SKIP_ENABLE=no.
    It's enabled by default. (It's not changed.)

  Modified files:
    lib/expr.c

  Modified: lib/expr.c (+18 -1)
===================================================================
--- lib/expr.c    2017-03-24 12:03:04 +0900 (7551321)
+++ lib/expr.c    2017-03-24 13:03:03 +0900 (da087dd)
@@ -43,6 +43,7 @@
 
 static double grn_table_select_enough_filtered_ratio = 0.0;
 static int grn_table_select_max_n_enough_filtered_records = 1000;
+static grn_bool grn_table_select_and_min_skip_enable = GRN_TRUE;
 
 void
 grn_expr_init_from_env(void)
@@ -68,6 +69,18 @@ grn_expr_init_from_env(void)
         atoi(grn_table_select_max_n_enough_filtered_records_env);
     }
   }
+
+  {
+    char grn_table_select_and_min_skip_enable_env[GRN_ENV_BUFFER_SIZE];
+    grn_getenv("GRN_TABLE_SELECT_AND_MIN_SKIP_ENABLE",
+               grn_table_select_and_min_skip_enable_env,
+               GRN_ENV_BUFFER_SIZE);
+    if (strcmp(grn_table_select_and_min_skip_enable_env, "no") == 0) {
+      grn_table_select_and_min_skip_enable = GRN_FALSE;
+    } else {
+      grn_table_select_and_min_skip_enable = GRN_TRUE;
+    }
+  }
 }
 
 grn_obj *
@@ -5765,7 +5778,11 @@ grn_table_select_index_match(grn_ctx *ctx,
   for (j = 0; j < n_indexes; j++, ip++, wp += 2) {
     uint32_t sid = (uint32_t) wp[0];
     int32_t weight = wp[1];
-    optarg.match_info.min = *min_id;
+    if (grn_table_select_and_min_skip_enable) {
+      optarg.match_info.min = *min_id;
+    } else {
+      optarg.match_info.min = 0;
+    }
     if (sid) {
       int weight_index = sid - 1;
       int current_vector_size;
-------------- next part --------------
HTML����������������������������...
Télécharger 



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