Commit 8a86c2f5 authored by Vincent Pelletier's avatar Vincent Pelletier

ZSQLCatalog: Also cache misses.

There are a lot of misses in this function because related keys must have
precedence over homonym columns, which makes it cost a *lot* of cpu time
to just return None.
parent 1ef9d9bd
...@@ -2035,7 +2035,6 @@ class Catalog(Folder, ...@@ -2035,7 +2035,6 @@ class Catalog(Folder,
try: try:
result = related_key_definition_cache[key] result = related_key_definition_cache[key]
except KeyError: except KeyError:
result = None
for entire_definition in self.getSQLCatalogRelatedKeyList([key]): for entire_definition in self.getSQLCatalogRelatedKeyList([key]):
split_entire_definition = entire_definition.split('|') split_entire_definition = entire_definition.split('|')
if len(split_entire_definition) != 2: if len(split_entire_definition) != 2:
...@@ -2044,7 +2043,8 @@ class Catalog(Folder, ...@@ -2044,7 +2043,8 @@ class Catalog(Folder,
if split_entire_definition[0].strip() == key: if split_entire_definition[0].strip() == key:
result = split_entire_definition[1].strip() result = split_entire_definition[1].strip()
break break
if result is not None: else:
result = None
related_key_definition_cache[key] = result related_key_definition_cache[key] = result
return result return result
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment