Influxdb: [feature request] SQL-like IN clause

Created on 30 Oct 2015  路  4Comments  路  Source: influxdata/influxdb

Hello,

Have you thought about implementing SQL-like IN clause? Now if I want to get results from multiple series I have to do something like:

SELECT last(value) FROM temperatures WHERE (cpu_id = '1' OR cpu_id = '2' OR cpu_id = '3') GROUP BY cpu_id

It works fine but is not really blazing fast, and might also make query really long.

I also tried a regex version:

SELECT last(value) FROM temperatures WHERE cpu_id =~ /1|2|3/ GROUP BY cpu_id

But the latter is way slower due to regex processing.

What would be great:

SELECT last(value) FROM temperatures WHERE cpu_id IN (1,2,3) GROUP BY cpu_id

Most helpful comment

Any news on this? It would be great to have this feature

All 4 comments

@jacekgrzybowski -- we might get to it in 0.9.5.

https://github.com/influxdb/influxdb/issues/2157

It works fine but is not really blazing fast, and might also make query really long.

Just so I am clear, would you expect IN to be any faster? I would not.

I have no knowledge about influx golang implementation, so I'm not eligible to answer that question :) However what I'm sure about is that I wouldn't have to prepare long strings of conditions in my application (joined with ORs and surrounded by commans).

Any news on this? It would be great to have this feature

Was this page helpful?
0 / 5 - 0 ratings

Related issues

deepujain picture deepujain  路  3Comments

ricco24 picture ricco24  路  3Comments

binary0111 picture binary0111  路  3Comments

Witee picture Witee  路  3Comments

allenbunny picture allenbunny  路  3Comments