[Groonga-commit] groonga/groonga at 7aedd87 [master] logical_range_filter: add fallback log

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Nov 14 18:51:39 JST 2015


Kouhei Sutou	2015-11-14 18:51:39 +0900 (Sat, 14 Nov 2015)

  New Revision: 7aedd87325665f34a008420367ab8691cba2442f
  https://github.com/groonga/groonga/commit/7aedd87325665f34a008420367ab8691cba2442f

  Message:
    logical_range_filter: add fallback log

  Modified files:
    plugins/sharding/logical_range_filter.rb

  Modified: plugins/sharding/logical_range_filter.rb (+8 -1)
===================================================================
--- plugins/sharding/logical_range_filter.rb    2015-11-14 18:41:09 +0900 (993ccb4)
+++ plugins/sharding/logical_range_filter.rb    2015-11-14 18:51:39 +0900 (9efe7c1)
@@ -507,7 +507,8 @@ module Groonga
               else
                 options[:limit] = current_limit
               end
-              options[:max_n_unmatched_records] = options[:limit] * 100
+              max_n_unmatched_records = options[:limit] * 100
+              options[:max_n_unmatched_records] = max_n_unmatched_records
               if @filter
                 create_expression(data_table) do |expression|
                   expression.parse(@filter)
@@ -523,6 +524,12 @@ module Groonga
               end
               if n_matched_records == -1
                 result_set.close
+                fallback_message =
+                  "fallback because there are too much unmatched records: "
+                fallback_message << "<#{max_n_unmatched_records}>"
+                decide_use_range_index(false,
+                                       fallback_message,
+                                       __LINE__, __method__)
                 execute_filter(nil, expression_builder)
                 return
               end
-------------- next part --------------
HTML����������������������������...
Télécharger 



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