Labels List Macro Causes Slow Page Loading in Confluence

XMLWordPrintable

    • 16
    • Severity 2 - Major
    • 69

      Issue Summary

      After upgrading Confluence from 9.2.3 to 9.2.6, pages that use the Labels List macro take a much longer time to load (~10x longer).

      Steps to Reproduce

      1. Install Confluence version 9.2.6
      2. Import a space (spacekey=ST) with than 320000 pages (space xml is attached in ST-ST-2025-07-10-16-02-24-050.xml_2025-08-05T04_20_20.672Z.zip)
      3. Create additional users and added some page restrictions to some pages in the space.
      4. Enable faster permissions.
      5. Fetch the content IDs by issuing this query, and save the results as labels.txt:
        SELECT c.contentid
        FROM CONTENT c
        JOIN BODYCONTENT bc
        	ON c.contentid = bc.contentid
        JOIN SPACES s
        	ON c.spaceid = s.spaceid
        WHERE c.prevver IS NULL
                AND c.contenttype IN ('PAGE', 'BLOGPOST')
                AND c.CONTENT_STATUS='current'
        		AND s.spacekey='ST'
        
      6. Utilize the fetched content IDs to create a bash script that adds unique labels to these pages (attached as label_2025-08-05T04_19_49.540Z.sh).
      7. Reorder some pages in the page tree.
      8. Perform a site reindex.
      9. Add a page (in a separate personal space) and add the Labels List macro (configured to display 5000 labels from the ST space).

      Expected Results

      The page should load quickly with little delay (about 1 second)

      Actual Results

      The page takes about 10 seconds to fully load.

      Workaround

      Reduce the number of labels displayed by the Labels List macro.

      Note

      You may also run the following SQL queries to assess the current usage of the Popular Label macro within your instance.

      To identify Confluence pages with Popular Label macro and their last modifier

      SELECT c.contentid, c.contenttype, c.title, s.spacekey, um.lower_username, c.lastmoddate
      FROM CONTENT c
      JOIN BODYCONTENT bc
          ON c.contentid = bc.contentid
      JOIN SPACES s
          ON c.spaceid = s.spaceid
      JOIN user_mapping um
          ON c.lastmodifier = um.user_key
      WHERE c.prevver IS NULL
      AND c.contenttype IN ('PAGE', 'BLOGPOST')
      AND bc.body LIKE '%ac:structured-macro ac:name="popular-labels"%'
      ORDER BY s.spacekey, c.lastmoddate DESC;
      

      To identify the users who frequently uses Popular Label macro

      SELECT c.contentid, c.contenttype, c.title, s.spacekey, um.lower_username, c.lastmoddate
      FROM CONTENT c
      JOIN BODYCONTENT bc
          ON c.contentid = bc.contentid
      JOIN SPACES s
          ON c.spaceid = s.spaceid
      JOIN user_mapping um
          ON c.lastmodifier = um.user_key
      WHERE c.prevver IS NULL
      AND c.contenttype IN ('PAGE', 'BLOGPOST')
      AND bc.body LIKE '%ac:structured-macro ac:name="popular-labels"%'
      ORDER BY s.spacekey, c.lastmoddate DESC;
      

            Assignee:
            Arun Antony
            Reporter:
            Jim Mulcahey
            Votes:
            35 Vote for this issue
            Watchers:
            38 Start watching this issue

              Created:
              Updated: