                      params.extend(h_params)
  
              if self.query.explain_query:
                  result.insert(0, self.connection.ops.explain_query_prefix(
                      self.query.explain_format,
                      **self.query.explain_options
                  ))
  
              if order_by:
                  ordering = []
                  for _, (o_sql, o_params, _) in order_by:
 
</s> remove             if self.query.explain_query:
 </s> add             if self.query.explain_info: </s> remove         output_formatter = json.dumps if self.query.explain_format == 'json' else str
 </s> add         output_formatter = json.dumps if self.query.explain_info.format == 'json' else str </s> remove         self.explain_query = False
        self.explain_format = None
        self.explain_options = {}
 </s> add         self.explain_info = None </s> remove         q.explain_query = True
        q.explain_format = format
        q.explain_options = options
 </s> add         q.explain_info = ExplainInfo(format, options)
                    self.query.explain_info.format,
                    **self.query.explain_info.options
                      params.extend(h_params)
  
              if self.query.explain_query:
                  result.insert(0, self.connection.ops.explain_query_prefix(
                    self.query.explain_info.format,
                    **self.query.explain_info.options
                    self.query.explain_info.format,
                    **self.query.explain_info.options
                  ))
  
              if order_by:
                  ordering = []
                  for _, (o_sql, o_params, _) in order_by:
keep keep keep keep replace replace keep keep keep keep keep
 Refs #27624 -- Changed Query.explain_info to namedtuple. 
django/db/models/sql/compiler.py