优化:统一来源筛选索引与后台构建

This commit is contained in:
2026-11-13 17:56:18 +08:00
parent 5068b8fbc9
commit 7782e33bec
29 changed files with 997 additions and 59 deletions
+6 -4
View File
@@ -9,9 +9,11 @@ import uuid
# These are measured business values, not documents that refer to source IDs.
VALUE_JSON = {('fact_black', 'raw_values'), ('fact_black', 'components'),
('fact_bright', 'raw_values'), ('fact_bright', 'components'),
('metric_rollup', 'components'), ('sales_order_metric_rollup', 'components')}
BUSINESS_VALUE_COLUMNS = {('fact_black', 'raw_values'), ('fact_black', 'components'),
('fact_bright', 'raw_values'), ('fact_bright', 'components'),
('metric_rollup', 'components'), ('sales_order_metric_rollup', 'components'),
('source_filter_field', 'column_name'),
('source_filter_value', 'value')}
TEXT_TYPES = {'json', 'text', 'mediumtext', 'longtext', 'tinytext'}
@@ -54,7 +56,7 @@ class Cleaner:
def metadata_mentions(self, needles, excluded=None):
for table, columns in self.db.column_types.items():
for column, kind in columns.items():
if kind not in TEXT_TYPES or (table, column) in VALUE_JSON:
if kind not in TEXT_TYPES or (table, column) in BUSINESS_VALUE_COLUMNS:
continue
conditions = ['LOCATE(%s,CAST(' + self.ident(column) + ' AS CHAR))>0' for _ in needles]
args = list(needles)