Reduce number of JOIN
-
Owner
What's the problem exactly with more JOINs ? Of course, the query was slower, but was it pathological to the point that filtering at ZODB level is faster ? Anyway, the following line crashes when stop_date is not defined:
if (document.getStartDate() < now < (document.getStopDate()+1)):
With Python 3, we'd have the same issue for start_date.
/cc @seb @vpelletier @kazuhiko
-
Owner
The join which is avoided here is a category->catalog join, by replacing a
$RELATION_$COLUMN
with a$RELATION_uid
condition. This is a good optimisation to me: ERP5 can quickly (or there is something seriously wrong in ERP5Site_getAuthenticatedMemberPersonValue) reach the most catalog-friendly value (an UID), so it should do that.I cannot comment on whether all destinations are necessarily Person documents - though it looks consistent with variable naming here.
-
Owner
Argg sorry for the noise. I had the feeling to see that this commit replaced catalog date comparison by Python. This commit is fine. I have a regression in my project but it seems to be elsewhere.