Go to file
Jonathan A. Sternberg 3d4d9062a0 Update subqueries so groupings are propagated to inner queries
Previously, only time expressions got propagated inwards. The reason for
this was simple. If the outer query was going to filter to a specific
time range, then it would be unnecessary for the inner query to output
points within that time frame. It started as an optimization, but became
a feature because there was no reason to have the user repeat the same
time clause for the inner query as the outer query. So we allowed an
aggregate query with an interval to pass validation in the subquery if
the outer query had a time range. But `GROUP BY` clauses were not
propagated because that same logic didn't apply to them. It's not an
optimization there. So while grouping by a tag in the outer query
without grouping by it in the inner query was useless, there wasn't any
particular reason to care.

Then a bug was found where wildcards would propagate the dimensions
correctly, but the outer query containing a group by with the inner
query omitting it wouldn't correctly filter out the outer group by. We
could fix that filtering, but on further review, I had been seeing
people make that same mistake a lot. People seem to just believe that
the grouping should be propagated inwards. Instead of trying to fight
what the user wanted and explicitly erase groupings that weren't
propagated manually, we might as well just propagate them for the user
to make their lives easier. There is no useful situation where you would
want to group into buckets that can't physically exist so we might as
well do _something_ useful.

This will also now propagate time intervals to inner queries since the
same applies there. But, while the interval propagates, the following
query will not pass validation since it is still not possible to use a
grouping interval with a raw query (even if the inner query is an
aggregate):

    SELECT * FROM (SELECT mean(value) FROM cpu) WHERE time > now() - 5m GROUP BY time(1m)

This also means wildcards will behave a bit differently. They will
retrieve dimensions from the sources in the inner query rather than just
using the dimensions in the group by.

Fixing top() and bottom() to return the correct auxiliary fields.
Unfortunately, we were not copying the buffer with the auxiliary fields
so those values would be overwritten by a later point.
2017-01-23 15:01:19 -06:00
.github Add Documentation Task to Pull Request Template 2016-12-07 10:14:05 -06:00
.hooks Fix incorrect composites check setting 2016-05-18 14:02:48 +01:00
client Merge remote-tracking branch 'influx/master' into mr-godoc 2017-01-04 13:27:36 -08:00
cmd Update subqueries so groupings are propagated to inner queries 2017-01-23 15:01:19 -06:00
coordinator Merge pull request #7869 from influxdata/er-rp-validate-1.2 2017-01-23 19:36:12 +00:00
etc Update config; fixes #7736 2016-12-20 16:17:07 +00:00
importer Add package comment for importer/v8 2016-12-30 11:58:43 -08:00
influxql Update subqueries so groupings are propagated to inner queries 2017-01-23 15:01:19 -06:00
internal Merge pull request #7747 from influxdata/mr-lint-cleanup 2017-01-10 08:22:00 -08:00
man Merge pull request #7492 from influxdata/mr-influx_inspect-help-verify 2016-11-07 13:23:39 -08:00
models Adjust Tags cloning 2017-01-13 13:15:36 -05:00
monitor Merge remote-tracking branch 'influx/master' into mr-godoc 2017-01-04 13:27:36 -08:00
pkg Update godoc for pkg 2016-12-30 18:03:01 -08:00
scripts Merge pull request #7536 from ast-systemtechnik/skladd-patch-init.sh 2016-12-01 14:08:10 -06:00
services Fixes #7860. 2017-01-23 19:01:13 +00:00
stress panicing is bad -> error returns are good 2017-01-03 14:28:29 -06:00
tcp Update godoc for packages tcp, toml, uuid 2016-12-30 18:03:02 -08:00
tests rename influxdb/influxdb to influxdata/influxdb 2016-02-10 10:26:18 -07:00
toml Update godoc for packages tcp, toml, uuid 2016-12-30 18:03:02 -08:00
tsdb allow partial writes on field conflicts 2017-01-23 11:54:46 -07:00
uuid Update godoc for packages tcp, toml, uuid 2016-12-30 18:03:02 -08:00
.dockerignore decouple circleci from tests using docker 2015-12-14 16:39:39 -07:00
.gitignore Add note to use global .gitignore 2016-10-17 08:33:13 -07:00
.mention-bot Filtering some authors from mention bot 2016-05-11 17:43:52 +01:00
CHANGELOG.md allow partial writes on field conflicts 2017-01-23 11:54:46 -07:00
CODING_GUIDELINES.md Fixes typo in CODING_GUIDELINES.md 2016-02-02 17:20:13 +05:30
CONTRIBUTING.md Fix small typo in CONTRIBUTING.md 2017-01-01 21:22:06 -08:00
DOCKER.md Update Go version to 1.7.4 2016-12-05 11:23:48 +00:00
Dockerfile Add instructions for building a minimal docker image 2015-08-07 14:27:33 -06:00
Dockerfile_build_ubuntu32 Update Go version to 1.7.4 2016-12-05 11:23:48 +00:00
Dockerfile_build_ubuntu64 Update Go version to 1.7.4 2016-12-05 11:23:48 +00:00
Dockerfile_build_ubuntu64_git Update Go version to 1.7.4 2016-12-05 11:23:48 +00:00
Dockerfile_test_ubuntu32 Use DEBIAN_FRONTEND=noninteractive when using apt-get in Dockerfiles 2016-02-18 21:58:14 -05:00
Godeps Use a dev copy of zap which consistently uses the proper imports 2016-12-15 14:43:11 -06:00
LICENSE Update year to 2016 in LICENSE 2016-01-16 13:09:14 +05:30
LICENSE_OF_DEPENDENCIES.md Update dependency 2016-12-14 18:23:36 +00:00
Makefile Update toml dependency for slice panic when reading the config 2016-02-23 08:45:01 -05:00
QUERIES.md Update QUERIES.md 2015-10-27 23:02:18 -07:00
README.md Add docker pull badge to the README 2016-05-15 22:05:17 -04:00
TODO.md Add TODO to change time boundaries for v2 2016-08-15 16:21:20 -05:00
appveyor.yml Use built-in Go 1.7 in Appveyor 2016-09-29 10:07:29 -07:00
build-docker.sh Update Go version to 1.7.4 2016-12-05 11:23:48 +00:00
build.py Fix ARM64 build by replacing "aarch64" string with "arm64" 2016-11-03 22:23:43 +00:00
build.sh rename influxdb/influxdb to influxdata/influxdb 2016-02-10 10:26:18 -07:00
circle-test.sh add docker rm flag so circleci can disable deletion of containers 2016-02-02 15:18:58 -07:00
circle.yml Update Go version to 1.7.4 2016-12-05 11:23:48 +00:00
errors.go Ensure ErrFieldTypeConflict value returned 2016-09-05 13:34:35 +01:00
gobuild.sh make tip container usable for any git revision, add go1.6beta1 test 2015-12-16 15:28:35 -07:00
influxdb.go Update godoc for the client packages 2016-12-30 11:58:43 -08:00
nightly.sh Update packaing and build for new github org 2016-01-04 15:47:04 -08:00
node.go Removed ineffective assignments, and added checks for errors that previsouly was not checked 2016-12-29 20:26:15 +01:00
package.sh Use go1.4.3 2016-01-10 16:43:31 -07:00
test.sh Update circle.yml to automate release upload on version tag. 2016-07-14 14:32:53 -05:00

README.md

InfluxDB Circle CI Go Report Card Docker pulls

An Open-Source Time Series Database

InfluxDB is an open source time series database with no external dependencies. It's useful for recording metrics, events, and performing analytics.

Features

  • Built-in HTTP API so you don't have to write any server side code to get up and running.
  • Data can be tagged, allowing very flexible querying.
  • SQL-like query language.
  • Simple to install and manage, and fast to get data in and out.
  • It aims to answer queries in real-time. That means every data point is indexed as it comes in and is immediately available in queries that should return in < 100ms.

Installation

We recommend installing InfluxDB using one of the pre-built packages. Then start InfluxDB using:

  • service influxdb start if you have installed InfluxDB using an official Debian or RPM package.
  • systemctl start influxdb if you have installed InfluxDB using an official Debian or RPM package, and are running a distro with systemd. For example, Ubuntu 15 or later.
  • $GOPATH/bin/influxd if you have built InfluxDB from source.

Getting Started

Create your first database

curl -G 'http://localhost:8086/query' --data-urlencode "q=CREATE DATABASE mydb"

Insert some data

curl -XPOST 'http://localhost:8086/write?db=mydb' \
-d 'cpu,host=server01,region=uswest load=42 1434055562000000000'

curl -XPOST 'http://localhost:8086/write?db=mydb' \
-d 'cpu,host=server02,region=uswest load=78 1434055562000000000'

curl -XPOST 'http://localhost:8086/write?db=mydb' \
-d 'cpu,host=server03,region=useast load=15.4 1434055562000000000'

Query for the data

curl -G http://localhost:8086/query?pretty=true --data-urlencode "db=mydb" \
--data-urlencode "q=SELECT * FROM cpu WHERE host='server01' AND time < now() - 1d"

Analyze the data

curl -G http://localhost:8086/query?pretty=true --data-urlencode "db=mydb" \
--data-urlencode "q=SELECT mean(load) FROM cpu WHERE region='uswest'"

Documentation

Contributing

If you're feeling adventurous and want to contribute to InfluxDB, see our contributing doc for info on how to make feature requests, build from source, and run tests.

Looking for Support?

InfluxDB offers a number of services to help your project succeed. We offer Developer Support for organizations in active development, Managed Hosting to make it easy to move into production, and Enterprise Support for companies requiring the best response times, SLAs, and technical fixes. Visit our support page or contact sales@influxdb.com to learn how we can best help you succeed.