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

Add DELETE query support #6484

Merged
merged 1 commit into from
Apr 27, 2016
Merged

Conversation

benbjohnson
Copy link
Contributor

@benbjohnson benbjohnson commented Apr 27, 2016

Overview

This commit adds query language support for deleting series with a DELETE query.

Fixes #1647

/cc @jwilder

Required for all non-trivial PRs
  • Rebased/mergable
  • Tests pass
  • CHANGELOG.md updated
  • Sign CLA (if not already signed)
Required only if applicable

@benbjohnson benbjohnson added this to the 0.13.0 milestone Apr 27, 2016
@toni-moreno
Copy link

+1

@@ -344,6 +344,7 @@ func (c *Cache) DeleteRange(keys []string, min, max int64) {
c.store[k].filter(min, max)
if c.store[k].count() == 0 {
delete(c.store, k)
continue
Copy link
Contributor

Choose a reason for hiding this comment

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

This will skip the c.size decrement below. Should add a c.size -= uint64(origSize) before continue

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed in 2cf25a1.

@jwilder
Copy link
Contributor

jwilder commented Apr 27, 2016

Needs a CHANGELOG update.

@benbjohnson benbjohnson force-pushed the delete-series branch 2 times, most recently from 01c019a to 2cf25a1 Compare April 27, 2016 20:59
@benbjohnson
Copy link
Contributor Author

@jwilder I forgot to push the CHANGELOG update. Fixed and pushed up.

This commit adds query language support for deleting series with a
`DELETE` query.
@jwilder
Copy link
Contributor

jwilder commented Apr 27, 2016

👍

@beckettsean
Copy link
Contributor

OMGYES!

@benbjohnson any initial thoughts on how performant this is? Is it something a user could run during normal operations or would it be advisable only against a quiescent database?

What's the difference between DELETE SERIES cpu vs. DROP SERIES cpu, neither with WHERE conditions. In the first case the series is still in the index and in the second it's not?

@benbjohnson benbjohnson deleted the delete-series branch April 27, 2016 23:22
@benbjohnson
Copy link
Contributor Author

@beckettsean I'm not sure. @jwilder did the tsm1 implementation. He could probably speak on the performance characteristics.

@jwilder
Copy link
Contributor

jwilder commented Apr 27, 2016

@beckettsean I'm still testing performance. Should work like drop series.

The difference between DELETE SERIES and DROP SERIES is that DELETE SERIES does not remove the series from the index so SHOW SERIES will still list it even if you deleted all data.

This behavior is a little odd after playing with this because, if you restart the server, the series are gone. @pauldix is there reason why DELETE SERIES should not remove the series from the index if the series data is fully removed?

@nemesifier
Copy link

Thanks for adding this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants