1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Duplicate xengallery_media would benefit from index on album_id

Discussion in 'Media Gallery Resolved Bugs' started by thedude, Mar 13, 2015.

  1. thedude

    thedude Well-Known Member

    XenGallery_Model_Media::getMediaForAlbumCache gets crushed by the lack of an album_id index when you run a rebuild on album thumbnails (we have 17,000+ albums). Adding the index for album_id on table xengallery_media makes it much faster.

    Also when viewing a user's album, XenGallery_Model_Media::countMedia gets called with the following query:
    FROM xengallery_media AS media
    WHERE (media.album_id = 12345) AND (media.media_state IN ('visible','deleted'))
    That query currently has to scan every row in the table because there's no index on album_id.
    imthebest likes this.
  2. imthebest

    imthebest Formerly Super120

  3. Chris D

    Chris D XenForo Developer Staff Member

    Indeed, the suggestions for these indexes have been implemented for XFMG 1.0.4.

Share This Page