Remove rev_join_map from sql/query.py
|Reported by:||akaariai||Owned by:||nobody|
|Component:||Database layer (models, ORM)||Version:||1.4|
|Has patch:||yes||Needs documentation:||no|
|Needs tests:||no||Patch needs improvement:||no|
The sql.query.QuerySet.rev_join_map is used currently in two places of the query.py:
- In query.combine(). The information used there is available directly from alias_map
- In relabel_aliases as a fast path to join_map. However, one can just iterate through the join_map and relabel the aliases directly.
It is hard to see if the usage in 1. is actually currently correct or not: when combining queries the joins are re-added using _table_ name for the left hand side of the join (the thing we are joining into). I am pretty sure the correct way would be to do that using the existing lhs _alias_ so that the joins are added to the same previous join as in the original query.
While the cleanup doesn't promise much advancement, it would give a (really) small speedup to query cloning. Just getting rid of one variable is reason enough for removal I guess.
Change History (5)
comment:1 Changed 3 years ago by akaariai
- Needs documentation unset
- Needs tests unset
- Patch needs improvement unset
Changed 3 years ago by akaariai
comment:2 Changed 3 years ago by claudep
- Has patch set
- Triage Stage changed from Unreviewed to Accepted
- Type changed from Uncategorized to Cleanup/optimization