Skip to content

Split /entity/{etype} for performance reasons.#28

Merged
xsedla1o merged 2 commits into
masterfrom
split_list_eids
Nov 21, 2024
Merged

Split /entity/{etype} for performance reasons.#28
xsedla1o merged 2 commits into
masterfrom
split_list_eids

Conversation

@xsedla1o
Copy link
Copy Markdown
Collaborator

Proposal PR to split the /entity/{etype} endpoint into two parts. The endpoint performs two queries, fetching paged documents and counting total number of documents matching the query. While convenient, counting all documents can become expensive on large databases, so it shouldn't be done on every page fetch.

The proposal introduces two new endpoints to perform the two actions separately.

  • /entity{etype}/get - fetching the snapshot list according to query
  • /entity{etype}/count - counting all snapshot documents according to query.
  • The original endpoint was deprecated, both in DP3 docs and in API schema (Swagger UI docs).

@xsedla1o xsedla1o requested a review from dbnk0 November 21, 2024 10:01
- Added endpoint to get only documents.
- Added endpoint to get only count.
- Deprecated original endpoint.
Copy link
Copy Markdown
Collaborator

@dbnk0 dbnk0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@xsedla1o xsedla1o merged commit 3209697 into master Nov 21, 2024
@xsedla1o xsedla1o deleted the split_list_eids branch November 21, 2024 13:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants