Uploaded image for project: 'Confluence Data Center'
  1. Confluence Data Center
  2. CONFSERVER-39498

Indexing causes table-scanning on os_propertyentry table when table was created using non-intl SQL Server dialect

    XMLWordPrintable

Details

    Description

      Summary

      Environment

      • Database is MS SQL Server
      • Confluence was installed using the Hibernate dialect net.sf.hibernate.dialect.SQLServerDialect (changing to net.sf.hibernate.dialect.SQLServerIntlDialect after installation does not change the tables) - usually this would mean Confluence was originally installed before 3.4 was released, as this is when the default was changed to Intl

      Steps to Reproduce

      1. Have Confluence installed as per the environment above
      2. Start a re-index
      3. Watch the slow query log on SQL Server, and observe that one query against OS_PROPERTYENTRY is taking the majority of the time, due to a table scan triggered by an implicit conversion of NVARCHAR to VARCHAR

      Expected Results

      There should be no table scanning caused by indexing.

      Actual Results

      There is table scanning caused by indexing. As a result the indexing process will be significantly slower.

      Workaround

      1. Stop Confluence
      2. Change all VARCHAR and TEXT fields in the OS_PROPERTYENTRY table to be instead NVARCHAR and NTEXT, as per the directions on the article https://confluence.atlassian.com/x/kIyEDQ under the section "Modify each data type manually".
      3. Start Confluence

      Fix

      1. Every table should have the same change applied as the workaround, and the property "hibernate.dialect" should be changed to net.sf.hibernate.dialect.SQLServerIntlDialect in confluence.cfg.xml in the Confluence home directory, if it isn't already. This will both completely avoid this bug, and also mean that unicode characters are correctly supported across the board.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              dmason David Mason (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: