This documentation relates to the latest version of Confluence.
If you are using an earlier version, please go to the documentation home page and select the relevant version.

MySQL index and PostgreSQL Contraint Trigger problem

All Versions
Click for all versions
Confluence 2.9 Documentation

Index

Pre-1.1 Confluence would add an extra copy of an index/constraint on a confluence database table every time the server was restarted. This has caused some users to run into memory problems such as CONF-1204 when the maximum limit of indexes per table has been reached.

To check if this problem exists in your installation, first open up a console window to your database.

For MySQL users, run:

	
     > show index from CONTENT;
You can verify this problem exists if you notice multiple indexes referencing the same column name like the following: 

BLOGSPACEID is duplicated by BLOGSPACEID_2 and both reference the BLOGSPACEID column

+---------+------------+---------------+--------------+-------------+
| Table   | Non_unique | Key_name      | Seq_in_index | Column_name |
+---------+------------+---------------+--------------+-------------+
| CONTENT |          0 | PRIMARY       |            1 | CONTENTID   |
| CONTENT |          1 | BLOGSPACEID   |            1 | BLOGSPACEID |
| CONTENT |          1 | PAGEID        |            1 | PAGEID      |
| CONTENT |          1 | PARENTID      |            1 | PARENTID    |
| CONTENT |          1 | PREVVER       |            1 | PREVVER     |
| CONTENT |          1 | SPACEID       |            1 | SPACEID     |
| CONTENT |          1 | DESCSPACEID   |            1 | DESCSPACEID |
| CONTENT |          1 | BLOGSPACEID_2 |            1 | BLOGSPACEID |
| CONTENT |          1 | PAGEID_2      |            1 | PAGEID      |
| CONTENT |          1 | PARENTID_2    |            1 | PARENTID    |
| CONTENT |          1 | PREVVER_2     |            1 | PREVVER     |
| CONTENT |          1 | SPACEID_2     |            1 | SPACEID     |
| CONTENT |          1 | DESCSPACEID_2 |            1 | DESCSPACEID |                                                          
+---------+------------+---------------+--------------+-------------+

For PostgreSQL users, run:

     > \d content;
You can verify this problem exists if you get lots of RI_ConstraintTriggers being displayed like the following:

Example: 
Triggers: RI_ConstraintTrigger_214459,
          RI_ConstraintTrigger_214460,
          RI_ConstraintTrigger_214465,
          RI_ConstraintTrigger_214466,
          RI_ConstraintTrigger_214468,
          RI_ConstraintTrigger_214469,
          RI_ConstraintTrigger_214482,
          RI_ConstraintTrigger_214483,
          RI_ConstraintTrigger_214484,

If you observe this in your database, you can fix the problem by performing the following:

  1. backup your existing confluence home directory and database
  2. upgrade to confluence 1.1
  3. login to Confluence
  4. goto Administration > Backup & Restore
  5. perform a backup by clicking the "Backup" button
  6. when the backup completes, download it (use the click "here" link)
  7. now go back to the Administration > Backup & Restore page
  8. restore the backup you have just made
  9. If you are using MySQL continue with the next 3 steps. Else skip to the end.
  10. shutdown confluence
  11. open up the confluence.cfg.xml file in your confluence home directory
  12. locate the line
    <property name="hibernate.dialect">net.sf.hibernate.dialect.MySQLDialect</property>

    and change it to:

    <property name="hibernate.dialect">bucket.dialect.MySQLDialect</property>
  13. now start up Confluence

Labels:

database database Delete
Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.