Kaydet (Commit) 2470756d authored tarafından Mariusz Felisiak's avatar Mariusz Felisiak Kaydeden (comit) Tim Graham

Moved select_sql in SQLCompiler.get_extra_select() to improve performance.

üst 48d92fea
...@@ -357,8 +357,8 @@ class SQLCompiler: ...@@ -357,8 +357,8 @@ class SQLCompiler:
def get_extra_select(self, order_by, select): def get_extra_select(self, order_by, select):
extra_select = [] extra_select = []
select_sql = [t[1] for t in select]
if self.query.distinct and not self.query.distinct_fields: if self.query.distinct and not self.query.distinct_fields:
select_sql = [t[1] for t in select]
for expr, (sql, params, is_ref) in order_by: for expr, (sql, params, is_ref) in order_by:
without_ordering = self.ordering_parts.search(sql).group(1) without_ordering = self.ordering_parts.search(sql).group(1)
if not is_ref and (without_ordering, params) not in select_sql: if not is_ref and (without_ordering, params) not in select_sql:
......
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