# How does grouping work? Does it work?

**URL:** <https://community.influxdata.com/t/how-does-grouping-work-does-it-work/7936>\
**Category:** Systems\
**Created:** [December 23, 2018, 12:43pm UTC](https://community.influxdata.com/t/how-does-grouping-work-does-it-work/7936 "2018-12-23T12:43:12Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![f1outsourcing](https://avatars.discourse-cdn.com/v4/letter/f/a183cd/32.png) [@f1outsourcing](https://community.influxdata.com/u/f1outsourcing)\
**Post date:** [December 23, 2018, 12:43pm UTC](https://community.influxdata.com/t/how-does-grouping-work-does-it-work/7936/1 "2018-12-23T12:43:12Z")

</div>

I am trying to downsample/rollup data. But I am stuck at the elementary task of grouping the data.

sample data is there

```
> select host,instance,type,type_instance from "1h"."ceph_value" where type_instance='ThrottleMsgrDispatchThrottlerCluster.val' order by time desc limit 20
name: ceph_value
time host instance type type_instance
---- ---- -------- ---- -------------
2018-12-23T11:35:07.481641609Z c02 osd.10 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:35:07.476608536Z c02 osd.9 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:35:07.471543086Z c02 osd.4 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:35:07.466502956Z c02 osd.1 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:35:04.614669505Z c01 osd.19 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:35:04.610445551Z c01 osd.17 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:35:04.605332069Z c01 osd.22 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:35:04.601295275Z c01 osd.8 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:35:04.597233546Z c01 osd.7 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:35:04.59315197Z c01 osd.6 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:35:04.588981428Z c01 osd.3 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:35:04.584909427Z c01 osd.0 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:35:03.054239701Z c04 osd.29 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:35:03.046408639Z c04 osd.25 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:35:03.038498256Z c04 osd.27 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:35:03.034461105Z c04 osd.23 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:35:03.03052819Z c04 osd.30 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:35:03.026477683Z c04 osd.28 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:35:00.385181303Z c03 osd.21 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:35:00.380155713Z c03 osd.16 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val

```

Where is the rest of the data, and why are there empty rows???

```
> SELECT mean(value) as value, last(host) as host, last(instance) as instance, last(type) as type, last(type_instance) as type_instance FROM "test"."1h"."ceph_value" WHERE type_instance='ThrottleMsgrDispatchThrottlerCluster.val' GROUP BY time(1m),host,instance,type,type_instance
name: ceph_value
tags: host=, instance=, type=, type_instance=
time value host instance type type_instance
---- ----- ---- -------- ---- -------------
2018-12-23T11:30:00Z 0 c02 osd.20 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:31:00Z 0 c02 osd.20 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:32:00Z 0 c02 osd.20 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:33:00Z 0 c02 osd.20 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:34:00Z 0 c02 osd.20 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:35:00Z 0 c02 osd.10 ceph_bytes ThrottleMsgrDispatchThrottlerCluster.val
2018-12-23T11:36:00Z
2018-12-23T11:37:00Z
2018-12-23T11:38:00Z
2018-12-23T11:39:00Z
2018-12-23T11:40:00Z
2018-12-23T11:41:00Z
...
...
...
```

---

<div class="post-metadata">

**Author:** ![dgnorton](https://sea1.discourse-cdn.com/flex023/user_avatar/community.influxdata.com/dgnorton/32/40_2.png) [@dgnorton](https://community.influxdata.com/u/dgnorton)\
**Post date:** [January 2, 2019, 4:26pm UTC](https://community.influxdata.com/t/how-does-grouping-work-does-it-work/7936/2 "2019-01-02T16:26:36Z")

</div>

Try adding a `WHERE time > now() - 5m` or similar to limit the time range being queried.

---

<div class="post-metadata">

**Author:** ![f1outsourcing](https://avatars.discourse-cdn.com/v4/letter/f/a183cd/32.png) [@f1outsourcing](https://community.influxdata.com/u/f1outsourcing)\
**Post date:** [January 4, 2019, 1:35pm UTC](https://community.influxdata.com/t/how-does-grouping-work-does-it-work/7936/3 "2019-01-04T13:35:58Z")

</div>

I just saw you closed this issue on github, mentioning answering at the community.

Yes, I figured that also, actually used  
`time >= '2018-12-29T12:04:00Z' AND time < '2018-12-29T12:09:00Z'`

But as you can imagine (if not from the subject line, and me mentioning it 2nd not 1st) these empty lines is just the minor part of the question, why do I not get grouped data?
