Project

General

Profile

Patch #33431 » time_query_performace_v2.patch

Alexander Meindl, 2020-05-12 14:49

View differences:

app/models/time_entry_query.rb
144 144
  def base_scope
145 145
    TimeEntry.visible.
146 146
      joins(:project, :user).
147
      includes(:activity).
148
      references(:activity).
149 147
      left_join_issue.
150 148
      where(statement)
151 149
  end
......
155 153

  
156 154
    order_option << "#{TimeEntry.table_name}.id ASC"
157 155
    base_scope.
156
      includes(:activity).
157
      references(:activity).
158
      where("#{Enumeration.table_name}.project_id = #{TimeEntry.table_name}.project_id").
158 159
      order(order_option).
159 160
      joins(joins_for_order_statement(order_option.join(',')))
160 161
  end
(2-2/5)