JIRA creates database indices automatically when the underlying table is created in the database. Hence, if you create a new installation of JIRA 3.0 or later, you do not need to create JIRA's database indices manually.
If you are upgrading JIRA from an earlier version (e.g. JIRA 2.6) and do not wish to create the indices manually, please follow the Migrating JIRA to Another Server instructions and recreate (drop and create) JIRA's database (or remove all tables in the database) AFTER successfully exporting your data and before doing the import into the new version of JIRA. Removing the database will force JIRA to recreate all tables in the database and hence create all required indices.
Please be aware: If you are upgrading from JIRA 2.6.1 or earlier to JIRA 3.0 (or above), JIRA will not create indices automatically, unless the database is removed and recreated.
If you do not wish to drop and recreate JIRA's database, you can add the indices manually by running the SQL statements shown below.
The syntax for creating indices differs between databases, so consult your documentation for the your database. In addition, if you change the database tables or fields that you use in
entitymodel.xml, you will need to change the shown SQL statements.
Below is the SQL for creating indices on PostgreSQL (you will probably need to alter this for your database):
Once you have created the index, you may need to tell your database to recompute its indices. For PostgreSQL, the command is
vacuumdb -U username -z -v database-name
Consult your database documentation for your database specific command.