DBRP Retention Policy

Hi there,

I’m using InfluxQl for InfluxDB 2.0. I would like to know when I did the dbrp mapping, is there any way that I can get all the information on the retention policy that is mapped? Maybe some sort of measurement that holds all the retention policy that is being mapped?

@faiz As far as I know, the only way to see a list of existing DBRP mappings is with the influx v1 dbrp list command.

Hi @scott,

If I may know is there any chance that I can recreate this, where I can have the persistent retention policy holds all the other retention policies in InfluxDB 2.x?

CREATE RETENTION POLICY “persistent” ON mydb DURATION INF REPLICATION 1
USE mydb
INSERT INTO persistent grafana_rp rp=“1_Minute” 604800000000000

In InfluxDB 2.0, “retention policies” don’t really exist anymore. 2.0 combines databases and retention policies into a single unit called a “bucket.” The DBRP mapping system is a specialized compatibility API that maps query and write requests to an appropriate bucket. So with 2.0, you can’t “add a retention policy;” CREATE RETENTION POLICY doesn’t work in 2.0.

What is your use case?

@scott then what is the use of DBRPs in v2? It doesn’t seem useful other than creating those if you want to use InfluxQL along with Flux in Grafana queries.

@pookie InfluxQL depends on retention policies as part of the FROM clause.

SELECT * FROM db.rp.measurement

The only time you don’t have to specify the retention policy with InfluxQL is if you’re using the default retention policy for the database you’re querying. In order to query with InfluxQL, you have to map database and retention policy combinations to a v2 bucket. Otherwise, InfluxQL doesn’t actually know what data to query.