Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.9.4.1] 'order by time desc' query does not order by time with different tags #4077

Closed
mblackstock opened this issue Sep 11, 2015 · 5 comments
Assignees

Comments

@mblackstock
Copy link

Testing out #2022 I came across this problem. Version 0.9.4-rc1

Using CLI:

> insert test-sensor value=12
> insert test-sensor value=13
> insert test-sensor value=14
> insert test-sensor value=15
> insert test-sensor,tag=example value=16
> select * from "test-sensor" order by time desc;
name: test-sensor
-----------------
time                tag value
2015-09-11T04:08:33.108825071Z      15
2015-09-11T04:08:30.996790711Z      14
2015-09-11T04:08:29.676833764Z      13
2015-09-11T04:08:59.500124703Z  example 16
2015-09-11T04:08:27.837381605Z      12

Note that most recently added point is 4th in the list. Adding another point with a different tag:

> insert test-sensor,tag2=example2 value=17
> select * from "test-sensor" order by time desc;
name: test-sensor
-----------------
time                tag tag2        value
2015-09-11T04:08:33.108825071Z              15
2015-09-11T04:08:30.996790711Z              14
2015-09-11T04:08:29.676833764Z              13
2015-09-11T04:15:14.500959481Z      example2    17
2015-09-11T04:08:59.500124703Z  example         16
2015-09-11T04:08:27.837381605Z              12

Note that most recently added point is again 4th in the list.

@mblackstock
Copy link
Author

Seeming related problem today in case it helps track this issue down.

I'm finding it hard to reproduce, but when I selected data in time ascending order (default) I get all of the data. When I queried in reverse order, I get only two points (see below). Tried the same query again later, and all of the data came in, but with the order messed up as previously reported (below)

> select * from "test-sensor-3";
name: test-sensor-3
-------------------
time                lat lng sensor_id   sensor_name tag value
2015-09-10T20:08:28.975Z            55      test-sensor-3       33
2015-09-10T20:08:33.089Z            55      test-sensor-3       33
2015-09-10T20:08:33.853Z            55      test-sensor-3       33
2015-09-10T21:05:42.792Z            55      test-sensor-3       33.5
2015-09-10T21:18:28.038513909Z                          example 33
2015-09-10T22:11:32.837607829Z                  test-sensor-3   example 33
2015-09-11T00:48:58.924000001Z                              99
2015-09-11T18:01:52.093000001Z  49  123                     12
2015-09-11T18:02:18.138000001Z  49  123                     12
2015-09-11T18:03:02.085000001Z  49  123                     12
2015-09-11T18:03:03.461000001Z  49  123                     12
2015-09-11T18:03:04.612000001Z  49  123                     12
2015-09-11T18:05:22.531000001Z  49  123                     12

> select * from "test-sensor-3" order by time desc limit 1000;
name: test-sensor-3
-------------------
time                lat lng sensor_id   sensor_name tag value
2015-09-10T22:11:32.837607829Z                  test-sensor-3   example 33
2015-09-10T21:18:28.038513909Z

later:

> select * from "test-sensor-3" order by time desc;
name: test-sensor-3
-------------------
time                lat lng sensor_id   sensor_name tag value
2015-09-10T22:11:32.837607829Z                  test-sensor-3   example 33
2015-09-11T18:08:30.275000001Z                              12
2015-09-11T18:08:15.035000001Z                              12
2015-09-11T18:05:22.531000001Z  49  123                     12
2015-09-11T18:03:04.612000001Z  49  123                     12
2015-09-11T18:03:03.461000001Z  49  123                     12
2015-09-11T18:03:02.085000001Z  49  123                     12
2015-09-11T18:02:18.138000001Z  49  123                     12
2015-09-11T18:01:52.093000001Z  49  123                     12
2015-09-11T00:48:58.924000001Z                              99
2015-09-10T21:18:28.038513909Z                          example 33
2015-09-10T21:05:42.792Z            55      test-sensor-3       33.5
2015-09-10T20:08:33.853Z            55      test-sensor-3       33
2015-09-10T20:08:33.089Z            55      test-sensor-3       33
2015-09-10T20:08:28.975Z            55      test-sensor-3       33

@hkrizek
Copy link

hkrizek commented Sep 16, 2015

+1

@richterger
Copy link

I see the same issue here. As soon as a new tag comes in, sorting in descending order gets confused.

I looks a little bit to me, like every time a new tag comes in, it starts a new "group" that is sorted on it's own.

@rackunits
Copy link

+1

@beckettsean beckettsean changed the title 'order by time desc' query does not order by time with different tags [0.9.4.1] 'order by time desc' query does not order by time with different tags Oct 28, 2015
@beckettsean
Copy link
Contributor

closing in favor of #4235, which although newer, has more conversation

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

No branches or pull requests

6 participants