Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
antbrown opened this issue Nov 30, 2023 · 0 comments
Open
Labels
Type: feature request a proposal for a new feature in the software (should be justified by a ‘use case’)

Comments

@antbrown
Copy link

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

@antbrown antbrown added the Type: feature request a proposal for a new feature in the software (should be justified by a ‘use case’) label Nov 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: feature request a proposal for a new feature in the software (should be justified by a ‘use case’)
Projects
None yet
Development

No branches or pull requests

1 participant