Skip to content
This repository has been archived by the owner on Dec 27, 2022. It is now read-only.

query optimization #8

Open
jcmartins opened this issue Jan 12, 2015 · 0 comments
Open

query optimization #8

jcmartins opened this issue Jan 12, 2015 · 0 comments

Comments

@jcmartins
Copy link

Hi,
I'm using Influxdb v0.8.8 with this handler.

this handler created a Serie with the same plugin name, exemple:
metric_cpu_pcnt
with the columns below:

time sequence_number value host metric
1421090211000 193692360001 1 i.5e2e894b.lb.tnt.portal.core.uat.sa.east.1.test.net lb.tnt-portal.core.uat.sa-east-1.cpu.total.user

I would like be a query to find a CPU consume per host like this:

select value from "metric_cpu_pcnt" where host =~ /^i.5e2e894b/ AND metric =~ /cpu.total.user$/ and time > now() - 15m;

This query is very slow because when the query use regex in the columns the regex needs to be match for EVERY measurement, and measurements for ALL "metrics" needs to be loaded.

Why this extension work this away?

The correct are not this: (serie name = hostname + metric) ?
series name: i.5e2e894b.lb.tnt-portal.core.uat.sa-east-1.cpu.total.user , columns: [time, value]

Because:
when the query use regex on the series names, not the column values, the series names are in memory in influxdb and the lookup and regex mach is quick as it only needs to be done once.

tks
Joao

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

No branches or pull requests

1 participant