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

Drop measurement was taking to long due to transactions #1990

Merged
merged 2 commits into from
Mar 17, 2015

Conversation

corylanou
Copy link
Contributor

Previously, if you had 10k series, it was creating 10k bolt transactions, which of course, takes a lot of time. Now, it creates significantly less transactions (only as many as you have shards). I was seeing results of DROP MEASUREMENT taking a couple minutes, and now takes less than 20ms.

@@ -1139,9 +1137,9 @@ func (db *database) dropMeasurement(name string) error {
}

// dropSeries will delete all data with the seriesID
func (rp *RetentionPolicy) dropSeries(seriesID uint32) error {
func (rp *RetentionPolicy) dropSeries(seriesIDs ...uint32) error {
Copy link
Member

Choose a reason for hiding this comment

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

I'm curious about this style. More preferred/idiomatic than doing []uint32? Or is it because you want to be able to support just passing in one ID?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

So, idiomatic is becoming a 4 letter word in the go community, but yes, it is to support sending a single series ID in the future.

This way, your signature for drop series would be dropSeries(id) as opposed to dropSeries([]SeriesIDs{id}).

This is very common to see in the standard library as well.

Copy link
Member

Choose a reason for hiding this comment

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

rad, I"ll have to remember it :)

@toddboom
Copy link
Contributor

As much as I would love to see tens of thousands of BoltDB transactions, this seems like a good idea to me. :shipit:

toddboom added a commit that referenced this pull request Mar 17, 2015
Drop measurement was taking to long due to transactions
@toddboom toddboom merged commit 8036799 into master Mar 17, 2015
@toddboom toddboom deleted the fix-drop-measurement branch March 17, 2015 18:12
@dgnorton
Copy link
Contributor

LGTM :shipit:

mark-rushakoff pushed a commit that referenced this pull request Jan 11, 2019
fix(http): convert scraper target error
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.

4 participants