Closed pauldix closed 9 years ago
@corylanou all of that is correct. The current show series
output is wrong, not sure why it looks like that. Can you update it?
I think the current syntax supported by the parser is wrong...
DROP SERIES <series name>
Are these the only two we need?...
DROP SERIES <id>
DROP SERIES FROM <measurement> WHERE <expr>
In the latter of the two, both the from-clause and where-clause would be optional?
In general, DROP
doesn't usually take a where
clause, so I'm torn.
My preference is both DROP
without a qualifier and DELETE
with a qualifier. Not sure if that makes it easier or harder to support in our system.
DELETE
removes data from something but doesn't completely get rid of the thing. In MySQL, DROP TABLE
doesn't allow a where-clause but their typical use-case doesn't need to support 100s-of-thousands of tables. It's practical in MySQL to say DROP TABLE tbl1, tbl2, ... , tbln
but it wouldn't be practical in Influx to list out thousands of series IDs (or names, if we were to support series names) so I think it makes sense to differ from typical SQL syntax and allow a where-clause on our DROP SERIES
statement.
@pauldix do you have a preference on this? Want to just get consensus before making the changes. I agree that we have a fairly different scenario here, and considering we really are "drop"ing an entity, that DROP
with an expression makes sense.
@dgnorton also, just to clarify, should we only support one way of it? Or do you still propose we support both as you outlined above:
DROP SERIES <id>
DROP SERIES FROM <measurement> WHERE <expr>
I favor supporting both DROP SERIES
syntaxes and using DELETE
only when deleting data from a series.
The commands suggested by @dgnorton make sense to me.
@corylanou what you have in your last comment is correct. Support dropping a specific series id or dropping all series from a measurement matching a where clause.
Further the the dimensions that show up in the where clause should only be tag keys. You shouldn't be able to have field names or time in the where clause of a drop series.
For DELETE
you'll be able to have fields and time in the where clause. Also, delete won't remove anything from the metastore.
After looking into this issue, I have several questions that I could use some feedback on.
Let us start with the example data for insert that we will use in the following discussions:
This will create two series, effectively:
host.server01.cpu
andhost.server02.cpu
, both of which we assign internal ids in the system for.If I query the current system, I get:
What I suggest we get is:
This would then allow us to do:
As well as issue a delete like this: