Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Improve trace id query #1626

Merged
merged 3 commits into from Oct 20, 2022
Merged

Improve trace id query #1626

merged 3 commits into from Oct 20, 2022

Conversation

cevian
Copy link
Contributor

@cevian cevian commented Sep 7, 2022

Description

Improves trace id query performance.

Fixes #1540.

Blocked by #1621. After #1621 is resolved, rebase and reapply these patches. Keep as draft until then.

Merge requirements

Please take into account the following non-code changes that you may need to make with your PR:

  • CHANGELOG entry for user-facing changes
  • Updated the relevant documentation

@arajkumar
Copy link
Member

@cevian Do you think this is still relevant after #1658?

@cevian
Copy link
Contributor Author

cevian commented Sep 21, 2022

@arajkumar yes it's still very relevant

Previously, the trace id query did a simple join between the trace,
events, links tables on trace/spanid WITHOUT using our time-frame
limiting logic.

This commit uses a subquery on the span table to get a time-range
first before doing all the other joins, which allows chunk exclusion
to limit the amount of data fetched from the links and events tables.

Fixes #1540
Combine queries together.
Other parts of the subquery are not needed when getting the time for
a given traceid
@cevian cevian marked this pull request as ready for review October 17, 2022 12:38
@cevian cevian requested a review from a team as a code owner October 17, 2022 12:38
Copy link
Member

@arajkumar arajkumar left a comment

Choose a reason for hiding this comment

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

lgtm

@niksajakovljevic niksajakovljevic merged commit a6d486c into master Oct 20, 2022
@niksajakovljevic niksajakovljevic deleted the improve_trace_id_query branch October 20, 2022 08:47
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

traces search slow
4 participants