Rollup measurement query amended (#11479)

By user request from https://groups.google.com/g/druid-user/c/bFkOtE-1eQg - gives the measure as a floating point instead of an integer.
This commit is contained in:
Peter Marshall 2021-07-27 14:29:29 +01:00 committed by GitHub
parent 676efb1b3f
commit 60fdf7a734
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 6 deletions

View File

@ -169,16 +169,18 @@ For an example of how to configure rollup, and of how the feature will modify yo
### Maximizing rollup ratio ### Maximizing rollup ratio
You can measure the rollup ratio of a datasource by comparing the number of rows in Druid with the number of ingested You can measure the rollup ratio of a datasource by comparing the number of rows in Druid (`COUNT`) with the number of ingested
events. The higher this number, the more benefit you are gaining from rollup. One way to do this is with a events. One way to do this is with a
[Druid SQL](../querying/sql.md) query like: [Druid SQL](../querying/sql.md) query such as the following, where "count" refers to a `count`-type metric generated at ingestion time:
```sql ```sql
SELECT SUM("cnt") / COUNT(*) * 1.0 FROM datasource SELECT SUM("count") / (COUNT(*) * 1.0)
FROM datasource
``` ```
In this query, `cnt` should refer to a "count" type metric specified at ingestion time. See The higher this number is, the more benefit you are gaining from rollup.
[Counting the number of ingested events](schema-design.md#counting) on the "Schema design" page for more details about
> See [Counting the number of ingested events](schema-design.md#counting) on the "Schema design" page for more details about
how counting works when rollup is enabled. how counting works when rollup is enabled.
Tips for maximizing rollup: Tips for maximizing rollup: