[Groonga-commit] groonga/groonga at 6b57f6a [master] logical_table_remove: remove indexes for reference tables on dependent mode

Back to archive index

Kouhei Sutou null+****@clear*****
Sat Mar 19 18:06:03 JST 2016


Kouhei Sutou	2016-03-19 18:06:03 +0900 (Sat, 19 Mar 2016)

  New Revision: 6b57f6a2e24296b7e1a214d4defaecc431f07d61
  https://github.com/groonga/groonga/commit/6b57f6a2e24296b7e1a214d4defaecc431f07d61

  Message:
    logical_table_remove: remove indexes for reference tables on dependent mode

  Modified files:
    plugins/sharding/logical_table_remove.rb
    test/command/suite/sharding/logical_table_remove/referenced/default.expected
    test/command/suite/sharding/logical_table_remove/referenced/default.test
    test/command/suite/sharding/logical_table_remove/referenced/dependent.expected
    test/command/suite/sharding/logical_table_remove/referenced/dependent.test

  Modified: plugins/sharding/logical_table_remove.rb (+6 -1)
===================================================================
--- plugins/sharding/logical_table_remove.rb    2016-03-19 15:38:59 +0900 (b29437e)
+++ plugins/sharding/logical_table_remove.rb    2016-03-19 18:06:03 +0900 (babe09b)
@@ -70,7 +70,12 @@ module Groonga
         if @dependent
           table.columns.each do |column|
             range = column.range
-            referenced_table_ids << range.id if range.is_a?(Table)
+            if range.is_a?(Table)
+              referenced_table_ids << range.id
+              range.indexes.each do |index_info|
+                referenced_table_ids << index_info.index.domain.id
+              end
+            end
             column.indexes.each do |index_info|
               referenced_table_ids << index_info.index.domain.id
             end

  Modified: test/command/suite/sharding/logical_table_remove/referenced/default.expected (+14 -0)
===================================================================
--- test/command/suite/sharding/logical_table_remove/referenced/default.expected    2016-03-19 15:38:59 +0900 (b981a3a)
+++ test/command/suite/sharding/logical_table_remove/referenced/default.expected    2016-03-19 18:06:03 +0900 (e2482da)
@@ -12,6 +12,10 @@ table_create Times_20150203 TABLE_PAT_KEY Time
 [[0,0.0,0.0],true]
 column_create Times_20150203 timestamp_index COLUMN_INDEX Logs_20150203 timestamp
 [[0,0.0,0.0],true]
+table_create PathTerms_20150203 TABLE_PAT_KEY   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create PathTerms_20150203 index COLUMN_INDEX|WITH_POSITION   Paths_20150203 _key
+[[0,0.0,0.0],true]
 table_create NotRelated_20150204 TABLE_NO_KEY
 [[0,0.0,0.0],true]
 table_create Paths_20150204 TABLE_HASH_KEY|KEY_LARGE ShortText
@@ -26,6 +30,10 @@ table_create Times_20150204 TABLE_PAT_KEY Time
 [[0,0.0,0.0],true]
 column_create Times_20150204 timestamp_index COLUMN_INDEX Logs_20150204 timestamp
 [[0,0.0,0.0],true]
+table_create PathTerms_20150204 TABLE_PAT_KEY   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create PathTerms_20150204 index COLUMN_INDEX|WITH_POSITION   Paths_20150204 _key
+[[0,0.0,0.0],true]
 load --table Logs_20150203
 [
 {"timestamp": "2015-02-03 12:49:00", "path": "/tmp/log"},
@@ -51,12 +59,16 @@ column_create Logs_20150203 timestamp COLUMN_SCALAR Time
 
 table_create Times_20150203 TABLE_PAT_KEY Time
 
+table_create PathTerms_20150203 TABLE_PAT_KEY --default_tokenizer TokenBigram --normalizer NormalizerAuto
+
 table_create NotRelated_20150204 TABLE_NO_KEY
 
 table_create Paths_20150204 TABLE_HASH_KEY|KEY_LARGE ShortText
 
 table_create Times_20150204 TABLE_PAT_KEY Time
 
+table_create PathTerms_20150204 TABLE_PAT_KEY --default_tokenizer TokenBigram --normalizer NormalizerAuto
+
 column_create Logs_20150203 path COLUMN_SCALAR Paths_20150203
 
 load --table Paths_20150203
@@ -90,3 +102,5 @@ load --table Times_20150204
 ]
 
 column_create Times_20150203 timestamp_index COLUMN_INDEX Logs_20150203 timestamp
+column_create PathTerms_20150203 index COLUMN_INDEX|WITH_POSITION Paths_20150203 _key
+column_create PathTerms_20150204 index COLUMN_INDEX|WITH_POSITION Paths_20150204 _key

  Modified: test/command/suite/sharding/logical_table_remove/referenced/default.test (+14 -0)
===================================================================
--- test/command/suite/sharding/logical_table_remove/referenced/default.test    2016-03-19 15:38:59 +0900 (7dbbb96)
+++ test/command/suite/sharding/logical_table_remove/referenced/default.test    2016-03-19 18:06:03 +0900 (dfb725a)
@@ -9,6 +9,13 @@ column_create Logs_20150203 path COLUMN_SCALAR Paths_20150203
 table_create Times_20150203 TABLE_PAT_KEY Time
 column_create Times_20150203 timestamp_index COLUMN_INDEX Logs_20150203 timestamp
 
+table_create PathTerms_20150203 TABLE_PAT_KEY \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create PathTerms_20150203 index COLUMN_INDEX|WITH_POSITION \
+  Paths_20150203 _key
+
+
 table_create NotRelated_20150204 TABLE_NO_KEY
 
 table_create Paths_20150204 TABLE_HASH_KEY|KEY_LARGE ShortText
@@ -18,6 +25,13 @@ column_create Logs_20150204 path COLUMN_SCALAR Paths_20150204
 table_create Times_20150204 TABLE_PAT_KEY Time
 column_create Times_20150204 timestamp_index COLUMN_INDEX Logs_20150204 timestamp
 
+table_create PathTerms_20150204 TABLE_PAT_KEY \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create PathTerms_20150204 index COLUMN_INDEX|WITH_POSITION \
+  Paths_20150204 _key
+
+
 load --table Logs_20150203
 [
 {"timestamp": "2015-02-03 12:49:00", "path": "/tmp/log"},

  Modified: test/command/suite/sharding/logical_table_remove/referenced/dependent.expected (+11 -0)
===================================================================
--- test/command/suite/sharding/logical_table_remove/referenced/dependent.expected    2016-03-19 15:38:59 +0900 (1c44d4f)
+++ test/command/suite/sharding/logical_table_remove/referenced/dependent.expected    2016-03-19 18:06:03 +0900 (7854110)
@@ -12,6 +12,10 @@ table_create Times_20150203 TABLE_PAT_KEY Time
 [[0,0.0,0.0],true]
 column_create Times_20150203 timestamp_index COLUMN_INDEX Logs_20150203 timestamp
 [[0,0.0,0.0],true]
+table_create PathTerms_20150203 TABLE_PAT_KEY   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create PathTerms_20150203 index COLUMN_INDEX|WITH_POSITION   Paths_20150203 _key
+[[0,0.0,0.0],true]
 table_create NotRelated_20150204 TABLE_NO_KEY
 [[0,0.0,0.0],true]
 table_create Paths_20150204 TABLE_HASH_KEY|KEY_LARGE ShortText
@@ -26,6 +30,10 @@ table_create Times_20150204 TABLE_PAT_KEY Time
 [[0,0.0,0.0],true]
 column_create Times_20150204 timestamp_index COLUMN_INDEX Logs_20150204 timestamp
 [[0,0.0,0.0],true]
+table_create PathTerms_20150204 TABLE_PAT_KEY   --default_tokenizer TokenBigram   --normalizer NormalizerAuto
+[[0,0.0,0.0],true]
+column_create PathTerms_20150204 index COLUMN_INDEX|WITH_POSITION   Paths_20150204 _key
+[[0,0.0,0.0],true]
 load --table Logs_20150203
 [
 {"timestamp": "2015-02-03 12:49:00", "path": "/tmp/log"},
@@ -51,6 +59,8 @@ column_create Logs_20150203 timestamp COLUMN_SCALAR Time
 
 table_create Times_20150203 TABLE_PAT_KEY Time
 
+table_create PathTerms_20150203 TABLE_PAT_KEY --default_tokenizer TokenBigram --normalizer NormalizerAuto
+
 table_create NotRelated_20150204 TABLE_NO_KEY
 
 column_create Logs_20150203 path COLUMN_SCALAR Paths_20150203
@@ -70,3 +80,4 @@ load --table Logs_20150203
 ]
 
 column_create Times_20150203 timestamp_index COLUMN_INDEX Logs_20150203 timestamp
+column_create PathTerms_20150203 index COLUMN_INDEX|WITH_POSITION Paths_20150203 _key

  Modified: test/command/suite/sharding/logical_table_remove/referenced/dependent.test (+14 -0)
===================================================================
--- test/command/suite/sharding/logical_table_remove/referenced/dependent.test    2016-03-19 15:38:59 +0900 (8f3c082)
+++ test/command/suite/sharding/logical_table_remove/referenced/dependent.test    2016-03-19 18:06:03 +0900 (793cdea)
@@ -9,6 +9,13 @@ column_create Logs_20150203 path COLUMN_SCALAR Paths_20150203
 table_create Times_20150203 TABLE_PAT_KEY Time
 column_create Times_20150203 timestamp_index COLUMN_INDEX Logs_20150203 timestamp
 
+table_create PathTerms_20150203 TABLE_PAT_KEY \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create PathTerms_20150203 index COLUMN_INDEX|WITH_POSITION \
+  Paths_20150203 _key
+
+
 table_create NotRelated_20150204 TABLE_NO_KEY
 
 table_create Paths_20150204 TABLE_HASH_KEY|KEY_LARGE ShortText
@@ -18,6 +25,13 @@ column_create Logs_20150204 path COLUMN_SCALAR Paths_20150204
 table_create Times_20150204 TABLE_PAT_KEY Time
 column_create Times_20150204 timestamp_index COLUMN_INDEX Logs_20150204 timestamp
 
+table_create PathTerms_20150204 TABLE_PAT_KEY \
+  --default_tokenizer TokenBigram \
+  --normalizer NormalizerAuto
+column_create PathTerms_20150204 index COLUMN_INDEX|WITH_POSITION \
+  Paths_20150204 _key
+
+
 load --table Logs_20150203
 [
 {"timestamp": "2015-02-03 12:49:00", "path": "/tmp/log"},
-------------- next part --------------
HTML����������������������������...
下載 



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