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

Revert "services/horizon: Limit time range to max of number of buckets in trades aggregation query (#2856)" #2893

Merged

Conversation

bartekn
Copy link
Contributor

@bartekn bartekn commented Aug 5, 2020

This reverts commit 85c4f66.

Unfortunately, the performance fix for /trade_aggregations in 85c4f66 does not work correctly if there are no trades for the requested market, range and resolution within a given limit (i.e. no data in a bucket in a range).

As an example, consider a market with no trades on weekends and the following params:

  • start_time = Monday, 1st day of the month (for simplicity),
  • end_time = Sunday, 14th,
  • resolution = 1 day,
  • limit = 7 days.

Before 85c4f66 Horizon returned 7 buckets for each day: Monday-Friday and Monday, Tuesday the following week. With 85c4f66 it returns just 5 buckets because the end_time would be overwritten to EOD, Sunday, 7th. This code works great when all buckets in the range are non-empty, however, if there's at least one empty bucket it will return less than limit buckets.

@bartekn bartekn requested a review from a team August 5, 2020 16:08
@cla-bot cla-bot bot added the cla: yes label Aug 5, 2020
@bartekn bartekn merged commit cdb9959 into stellar:release-horizon-v1.7.0 Aug 5, 2020
@bartekn bartekn deleted the revert-trade-agg-limit branch August 5, 2020 16:24
paulbellamy pushed a commit to paulbellamy/stellar-go that referenced this pull request May 6, 2021
…f buckets in trades aggregation query (stellar#2856)" (stellar#2893)"

This reverts commit cdb9959.
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