# Most efficient way to compute number of rows in each group using JuliaDB?

**URL:** https://discourse.julialang.org/t/most-efficient-way-to-compute-number-of-rows-in-each-group-using-juliadb/28256
**Category:** Data
**Tags:** juliadb
**Created:** [September 1, 2019, 8:01am UTC](https://discourse.julialang.org/t/most-efficient-way-to-compute-number-of-rows-in-each-group-using-juliadb/28256 "2019-09-01T08:01:37Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![xiaodai](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/xiaodai/32/15937_2.png) [@xiaodai](https://discourse.julialang.org/u/xiaodai)
#### Post date: [September 1, 2019, 8:01am UTC](https://discourse.julialang.org/t/most-efficient-way-to-compute-number-of-rows-in-each-group-using-juliadb/28256/1 "2019-09-01T08:01:37Z")

</div>

Suppose `a` is a JuliaDB table, is the below the best (most efficient) way to compute the number of rows per group?

```julia
using LambdaFn, DataFrames, JuliaDB
a = DataFrame(Column1 = rand(["a", "b", "c"], 1_000), b = rand(1000)) |> JuliaDB.table

@time JuliaDB.groupby(@λ(size(_,1)), a, :Column1) 

```
