Skip to content

Feature request: Cache terms returned by IslandoraUtils::getTermForUri() #2272

@antbrown

Description

@antbrown

Overview of feature request

Currently our slow query log is chock full of queries looking like this:

SELECT "base_table"."revision_id" AS "revision_id", "base_table"."tid" AS "tid" 
FROM
"taxonomy_term_data" "base_table" 
LEFT JOIN "taxonomy_term__field_authority_link" "taxonomy_term__field_authority_link" ON "taxonomy_term__field_authority_link"."entity_id" = "base_table"."tid" 
LEFT JOIN "taxonomy_term__field_external_authority_link" "taxonomy_term__field_external_authority_link" ON "taxonomy_term__field_external_authority_link"."entity_id" = "base_table"."tid" 
LEFT JOIN "taxonomy_term__field_external_uri" "taxonomy_term__field_external_uri" ON "taxonomy_term__field_external_uri"."entity_id" = "base_table"."tid" 
WHERE ("taxonomy_term__field_authority_link"."field_authority_link_uri" = http://pcdm.org/use#OriginalFile') or ("taxonomy_term__field_external_authority_link"."field_external_authority_link_uri" = http://pcdm.org/use#OriginalFile') or ("taxonomy_term__field_external_uri"."field_external_uri_uri" = http://pcdm.org/use#OriginalFile')\G

It looks like these results should be cacheable as the terms relating to the external uri don't change all that often.

What kind of user is the feature intended for?

Developers.

What inspired the request?

Slow query log.

What existing behavior do you want changed?

IslandoraUtils::getTermForUri() should cache the term it finds and return the cached item.

Any related open or closed issues to this feature request?

Possibly #1693

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requesta proposal for a new feature in the software (should be justified by a ‘use case’)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions