influxdb icon indicating copy to clipboard operation
influxdb copied to clipboard

timeseries store & query.

Open iamlaokui opened this issue 12 years ago • 5 comments

It's not actually a issue, but a discussion.

I have look at leveldb_datastore.go and, want to ask about How these points in a timeseries be saved in leveldb.

  1. It's better to have a cache for caching id <--> database ~ series ~ column relation for reducing duplicated query for leveldb, we should not relay on leveldb level buffer.
  2. It's seem like influxdb split each columns in a series to leveldb keys for saving these values. that may cause lot's of duplicated values saved for a 'tag' like column, and querying these column may also cost useless times. Say we have
{name: 'cpuidle', fields:['value', 'timestamp', 'ip'], values:[
[12, 139098137100, '202.188.188.188'],
[13, 139098137200, '202.188.188.188'],
[14, 139098137300, '202.188.188.188'],
[15, 139098137400, '202.188.188.188'],
....
]}

Influxdb will save lots of IP keys (i,e KEY=database~cpuidle~ip:Timestamp, VALUE= '202.188.188.188') in leveldb. ip is more like tag, not value in this timeseries. So we may consider to optimize these columns for quick querying and saving disk I/O.

iamlaokui avatar Jan 29 '14 14:01 iamlaokui

If IP is a tag it is probably better off in the time series name. So you create a separate series per IP.

Although we have thought about potentially specifying a schema where you could specify a column as a tag type so that the string would be converted into a small int and then that would be stored.

We'll definitely be adding an LRU for the (db, series, column) to id map. Just not a concern for the moment.

On Wed, Jan 29, 2014 at 9:12 AM, piaoyuankui [email protected]:

It's not actually a issue, but a discussion.

I have look at leveldb_datastore.go and, want to ask about How these points in a timeseries be saved in leveldb.

It's better to have a cache for caching id <--> database ~ series ~ column relation for reducing duplicated query for leveldb, we should not relay on leveldb level buffer. 2.

It's seem like influxdb split each columns in a series to leveldb keys for saving these values. that may cause lot's of duplicated values saved for a 'tag' like column, and querying these column may also cost useless times. Say we have

{name: 'cpuidle', fields:['value', 'timestamp', 'ip'], values:[ [12, 139098137100, '202.188.188.188'], [13, 139098137200, '202.188.188.188'], [14, 139098137300, '202.188.188.188'], [15, 139098137400, '202.188.188.188'], .... ]}

Influxdb will save lots of IP keys (i,e KEY=database~cpuidle~ip:Timestamp, VALUE= '202.188.188.188') in leveldb. ip is more like tag, not value in this timeseries. So we may consider to optimize these columns for quick querying and saving disk I/O.

Reply to this email directly or view it on GitHubhttps://github.com/influxdb/influxdb/issues/212 .

pauldix avatar Jan 29 '14 14:01 pauldix

The fact is that IPs may have thousands or more. And it's better to be added as a column so All Query method is support for ip. like,

select * cpuidle where ip = IP (or regex).

I am agree with you for define a schema to specify a column as a tag, looking forward to coming release. ;)

iamlaokui avatar Jan 29 '14 14:01 iamlaokui

You can achieve the same effect with a merge (in the next release):

select * from merge(/cpuidle.10..*/)

Or you can do the specific series:

select * from cpuidle.10.23.1.86

On Wed, Jan 29, 2014 at 9:52 AM, piaoyuankui [email protected]:

The fact is that IPs may have thousands or more. And it's better to be added as a column so All Query method is support for ip. like,

select * cpuidle where ip = IP (or regex).

I am agree with you for define a schema to specify a column as a tag, looking forward to coming release. ;)

Reply to this email directly or view it on GitHubhttps://github.com/influxdb/influxdb/issues/212#issuecomment-33590802 .

pauldix avatar Jan 29 '14 15:01 pauldix

Awesome You!

iamlaokui avatar Jan 29 '14 15:01 iamlaokui

Duplicate of #72

jvshahid avatar Jul 11 '14 18:07 jvshahid