I’ve searched high and low, and I cannot find anything in InfluxDB 2.x that is equivalent to InfluxDB 1.x DROP MEASUREMENT. I realise I can drop buckets, but that seems like a fairly coarse approach if you simply want to drop a measurement (e.g. which may have been mistakenly created).
Is this functionality deliberately omitted, or has it just not landed yet?
Hello @dswarbrick,
I image it will be added again. You could also create an issue to help prioritize it.
EDIT:
No - However a “predicate delete” is being added to the API that will allow delete based on a tagset filter. … so different implementation but same functionality
Thanks for your reply. It’s good to know that this functionality is still planned to be included. It sounds like it will be more analogous to “DROP SERIES … WHERE …”, than “DROP MEASUREMENT”. Would that be a fair assumption?
We’ve always been told that deleting data from time series DBs is bad, and we should instead just wait for it to age out by retention policy. Will these recommendations still apply to InfluxDB 2.x? There are likely to still be some occasions where data was inserted erroneously, and waiting for it to age out is not an option, especially if the bucket retention policy is long.
Failed for me. Dropping measurements is documented as a way to reduce excessive index cardinality having ingested too many tags. Now
delete(predicate=’’’_measurement=“order book”)
Then I reingest the data with fewer tags
In Data explore tags show up again and it takes 20min just to load ~700Mb of the entire measurement. A simple select. I have never seen such terrible performance. after 2 accidental tags, each ~50 entries.
Querying Influx ONCE more just to dump the data out of if. Probably setting up q. For 4h tried DROP Measurement. Reading here. 2x doesn support it.
Curl, Python Client, Postman → everywhere “undefined identifier DROP”
This Works for me & it deletes all the contents of the measurement
influx delete --bucket “Put the Name of yours” --org “Put the Name of yours” --predicate ‘_measurement=“Put the Name of yours”’ --start “2022-11-06T14:30:00Z” --stop “Put the Stop Time” --token “Put your Token Here”
I have used this several times in my gcp cloud db. If you select a from and to date that removes all records, I removes the measurement as well (as in, nothing left)
disclaimer: use it wisely and test it before running as you can wipe out your data with a click of a button…