Eagerly Cache NodeAssociations

XMLWordPrintable

      NOTE: This suggestion is for JIRA Cloud. Using JIRA Server? See the corresponding suggestion.

      Currently we get the NodeAssociations from the database for each issue for every association. However, it may be useful to get these all in one database call.

      We can cache them in a ThreadLocal, so that subsequent hits to the NodeAssociationManager doesn't incur the database hit. This may also reduce the need for the IssueCache.

      From the current entities that we store in that table, it would make sense to cache them all:

      insomniac=# select distinct source_node_entity from nodeassociation ;
      source_node_entity
      --------------------
      Issue
      Project
      (2 rows)

      insomniac=# select distinct sink_node_entity from nodeassociation ;
      sink_node_entity
      -----------------------
      Component
      IssueTypeScreenScheme
      NotificationScheme
      PermissionScheme
      Version
      (5 rows)

      insomniac=# select distinct association_type from nodeassociation ;
      association_type
      ------------------
      IssueComponent
      IssueFixVersion
      IssueVersion
      ProjectScheme

      We should also bound this cache, so that in any thread that hits lots of NodeAssociations, we don't load them all into memory.

              Assignee:
              Unassigned
              Reporter:
              Scott Farquhar
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: