Assets referenced custom field slow to load
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
When setting up an Assets referenced custom field, it has been observed that the loading time for this particular field is relatively slower compared to other fields Assets fields.
Diagnosis
Verifying the attribute that is been configured as the reference, we can see that this attribute is not indexed:

We can also verify this in the Jira database, by running the following SQL query:
PostgreSQL
1
select "NAME", "INDEXED" from "AO_8542F1_IFJ_OBJ_TYPE_ATTR" WHERE "ID" = <ATTRIBUTE_ID>;
MySQL
1
select NAME, INDEXED from AO_8542F1_IFJ_OBJ_TYPE_ATTR WHERE ID = <ATTRIBUTE_ID>;
ℹ️ In the example above, the ID would be 2597.
We could also verify if there are any additional attributes not indexed in the schema level. Make sure to have all attributes indexed for object types. We can get the Attributes which are not indexed per Object Schema with this SQL query:
POSTGRESQL
1
2
3
4
5
6
7
8
9
10
11
SELECT
*
FROM
"AO_8542F1_IFJ_OBJ_TYPE_ATTR" OTA
LEFT OUTER JOIN "AO_8542F1_IFJ_OBJ_TYPE" OT
ON
OT."ID" = OTA."OBJECT_TYPE_ID"
WHERE
OT."OBJECT_SCHEMA_ID" = '<SCHEMA-ID>'
AND
OTA."INDEXED" IS NOT TRUE;
ℹ️ Replace <SCHEMA-ID> with your schema ID: Assets (formerly Insight): How to get the IDs of object schema, object type and object from the Jira User Interface
Cause
For an unknown reason, the referenced attribute has the INDEXED column set to false, 0, or NULL:

To optimize the performance of the custom field, it's important to index all attributes with references. Otherwise, the results may be slowed down due to a known bug when attributes are not indexed: JSDSERVER-12125 - Insight [Asset] fetches all (esp. un-indexed) attributes even if they are not visible in Insight Custom Field Configuration fixed in 5.15.2
Solution
Workaround 1 (Recommended)
Re-create the attribute, this will set it as indexed.
Workaround 2
Manually set the object as INDEXED, by modifying the INDEXED column in the Jira database.
Always back up your data before making any database modifications. If possible, test any alter, insert, update, or delete SQL commands on a staging server first.
PostgreSQL
1
UPDATE "AO_8542F1_IFJ_OBJ_TYPE_ATTR" SET "INDEXED" = 'true' WHERE "ID" = <ATTRIBUTE_ID>;
MySQL
1
UPDATE AO_8542F1_IFJ_OBJ_TYPE_ATTR SET INDEXED = 1 WHERE ID = <ATTRIBUTE_ID>;
Was this helpful?