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

Prevent unnecessary queries to the 'ezbinaryfile' table

    XMLWordPrintable

Details

    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.

      Attachments

        Activity

          People

            Unassigned Unassigned
            nuno.oliveira-obsolete@ez.no Nuno Oliveira (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated: