Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-23076

Prevent unnecessary queries to the 'ezbinaryfile' table

    Details

    • Type: Improvement Improvement
    • Status: Confirmed
    • Priority: High High
    • Resolution: Unresolved
    • Affects Version/s: 5.3.1
    • Fix Version/s: Customer request
    • Component/s: Database related
    • Labels:
      None

      Description

      When you have a class with attributes of type "file", a SELECT query to the 'ezbinaryfile' table will be made for each attribute of that type, even if no files were uploaded. This should not happen.

      In order to verify this behavor, create a simple class with a text line attribute for the title, and 3 (for example) file attributes. Then, create a content for that class, with a title but no files, and symfony profiler will return 3 identical queries for the 'ezbinaryfile' table:

      SELECT
        `filename`,
        `mime_type`,
        `original_filename`,
        `download_count`
      FROM
        `ezbinaryfile`
      WHERE
        (
          `contentobject_attribute_id` = : placeholder1
          AND `version` = : placeholder2
        )
      

      Since no files were uploaded, no SELECT queries should have been created in the first place.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Unassigned
            Reporter:
            Nuno Oliveira (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated: