Skip to content

[Tagging] Reduce the number of queries used in content tagging REST API #185

@pomegranited

Description

@pomegranited

"As a content author, I need content tagging APIs to respond quickly and efficiently, so that I don't waste time waiting for the UIs to load."

As part of openedx/edx-platform#34004 we had tests that verified that the number of query counts made by the content taxonomy REST APIs were not increased by adding user permissions to the response. This revealed that the content tagging REST APIs make too many queries when compiling their responses:

  • 16 queries to list the taxonomies enabled for an org (compared to 5 queries from the equivalent oel_tagging library endpoint.)
  • 7 queries to retrieve object tags for an object (compared to 1 query for oel_tagging).
  • 13 queries to search for tags under a parent (compared to 5 queries for oel_tagging)

A likely cause for these discrepancies is the org-based rules logic, and permission checks being run too often. But there may also be query sets that would benefit from an added select_related.

See also this comment about cross-org tagging and taxonomy admins -- address this issue too.

Acceptance criteria

  • Query counts for content tagging REST APIs reduced (ideally O(1) like their oel_tagging equivalents).
  • Tests which validate the above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions