File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -188,17 +188,22 @@ querySchemaCache conf@AppConfig{..} = do
188188 , dbMediaHandlers = HM. union mHdlers initialMediaHandlers -- the custom handlers will override the initial ones
189189 , dbTimezones = tzones
190190
191- , dbTablesFuzzyIndex =
192- -- Only build fuzzy index for schemas with a reasonable number of tables
193- -- Fuzzy.FuzzySet is memory heavy we just don't use it for large schemas
194- Fuzzy. fromList <$> HM. filter ((< maxDbTablesForFuzzySearch) . length ) (HM. fromListWith (<>) ((qiSchema &&& pure . qiName) <$> HM. keys tabsWViewsPks))
191+ , dbTablesFuzzyIndex = tablesFuzzyIndex tabsWViewsPks
195192 }, qsTime)
196193 where
197194 schemas = toList configDbSchemas
198195 isLogDebug = configLogLevel == LogDebug
199196 sqlTimedStmt = sqlTimedStatement isLogDebug
200197 sleepCall = SQL. Statement " select pg_sleep($1 / 1000.0)" (param HE. int4) HD. noResult True
201198
199+ tablesFuzzyIndex :: TablesMap -> TablesFuzzyIndex
200+ tablesFuzzyIndex tabs =
201+ -- Only build fuzzy index for schemas with a reasonable number of tables
202+ -- Fuzzy.FuzzySet is memory heavy we just don't use it for large schemas
203+ Fuzzy. fromList <$>
204+ HM. filter ((< maxDbTablesForFuzzySearch) . length )
205+ (HM. fromListWith (<>) ((qiSchema &&& pure . qiName) <$> HM. keys tabs))
206+
202207-- | overrides detected relationships with the computed relationships and gets the RelationshipsMap
203208getOverrideRelationshipsMap :: [Relationship ] -> [Relationship ] -> RelationshipsMap
204209getOverrideRelationshipsMap rels cRels =
You can’t perform that action at this time.
0 commit comments