Skip to content
Snippets Groups Projects
Commit 3ddc6796152c authored by Arthur Lutz's avatar Arthur Lutz
Browse files

[optimisation] cwuri need to be in RQL, otherwise it *really* slows down the...

[optimisation] cwuri need to be in RQL, otherwise it *really* slows down the indexing when cw accesses entity.cw_uri.

Update using entity.cw_attr_cache should be enough, no need to loop over attributes again
parent cab90345e584
No related branches found
No related tags found
No related merge requests found
......@@ -38,22 +38,6 @@
'eid': entity.eid,
'cwuri': entity.cwuri,
}
for rschema in entity.e_schema.indexable_attributes():
attr = rschema.type
try:
value = entity.cw_attr_cache[attr]
except KeyError:
# Bytes
continue
data[attr] = value
for rschema, tschema in entity.e_schema.attribute_definitions():
if tschema.type in ('Int', 'Float'):
attr = rschema.type
try:
value = entity.cw_attr_cache[attr]
except KeyError:
continue
data[attr] = value
data.update(entity.cw_attr_cache)
# TODO take a look at what's in entity.cw_relation_cache
return data
......
......@@ -97,7 +97,7 @@
var = next(varmaker)
rql.append('%s %s %s' % (V, attr, var))
selected.append(var)
for attr in ('creation_date', 'modification_date',) + CUSTOM_ATTRIBUTES.get(etype, ()):
for attr in ('creation_date', 'modification_date', 'cwuri') + CUSTOM_ATTRIBUTES.get(etype, ()):
var = next(varmaker)
rql.append('%s %s %s' % (V, attr, var))
selected.append(var)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment