Patch #37350

Do not load attachments in query list with description and last_notes

Added by Alexander Meindl about 1 month ago. Updated about 1 month ago.

Status:ClosedStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:Issues list
Target version:-

Description

Currently if you enable description and last notes inline columns in issue list, textilizable loads not required attachments. Attachments are not displayed in this list => it is not required to load it.

This behaviour create lot of not required database queries like:

  Attachment Load (0.4ms)  SELECT `attachments`.* FROM `attachments` WHERE `attachments`.`container_id` = 62115 AND `attachments`.`container_type` = 'Issue' ORDER BY attachments.created_on ASC, attachments.id ASC /*application:RedmineApp,controller:issues,action:index*/
  ↳ app/helpers/application_helper.rb:940:in `+'
  Attachment Load (0.4ms)  SELECT `attachments`.* FROM `attachments` WHERE `attachments`.`container_id` = 62114 AND `attachments`.`container_type` = 'Issue' ORDER BY attachments.created_on ASC, attachments.id ASC /*application:RedmineApp,controller:issues,action:index*/
  ↳ app/helpers/application_helper.rb:940:in `+'
  Attachment Load (0.4ms)  SELECT `attachments`.* FROM `attachments` WHERE `attachments`.`container_id` = 62113 AND `attachments`.`container_type` = 'Issue' ORDER BY attachments.created_on ASC, attachm

The attachment patch solves this problem.

textilizable_without_attachment.patch Magnifier (951 Bytes) Alexander Meindl, 2022-06-26 11:48

History

#1 Updated by Mischa The Evil about 1 month ago

  • Status changed from New to Needs feedback

Alexander Meindl wrote:

... Attachments are not displayed in this list => it is not required to load it...

This is not true. If image attachments are included in either the description or journals using the respective wiki syntax (!!), the images are rendered in the inline columns in the issue list. See e.g. this query on redmine.org.
This change breaks this behavior.

#2 Updated by Alexander Meindl about 1 month ago

Hi Mischa The Evil,

you are right! This issue can be closed, sorry for this needless noise.

#3 Updated by Marius BALTEANU about 1 month ago

  • Status changed from Needs feedback to Closed

Closing, thanks for your feedback.

Also available in: Atom PDF