# Quickly determine number of rows in your database

**URL:** <https://forum.tiledb.com/t/quickly-determine-number-of-rows-in-your-database/642>\
**Category:** Uncategorized\
**Created:** [November 29, 2023, 10:09pm UTC](https://forum.tiledb.com/t/quickly-determine-number-of-rows-in-your-database/642 "2023-11-29T22:09:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Scott\_Syms](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/scott_syms/32/305_2.png) [@Scott\_Syms](https://forum.tiledb.com/u/Scott_Syms)\
**Post date:** [November 29, 2023, 10:09pm UTC](https://forum.tiledb.com/t/quickly-determine-number-of-rows-in-your-database/642/1 "2023-11-29T22:09:46Z")

</div>

I suspect there’s an obvious answer for this, but is there a quick way to obtain the number of rows in your database?

tks

S

---

<div class="post-metadata">

**Author:** ![Dirk\_Eddelbuettel](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/dirk_eddelbuettel/32/54_2.png) [@Dirk\_Eddelbuettel](https://forum.tiledb.com/u/Dirk_Eddelbuettel)\
**Post date:** [November 30, 2023, 1:00am UTC](https://forum.tiledb.com/t/quickly-determine-number-of-rows-in-your-database/642/2 "2023-11-30T01:00:13Z")

</div>

Hi @Scott_Syms

We just started to add the ability run aggregates, including ‘Count’ in the most recent 2.18.\* release series. The [example file for the C++ API](https://github.com/TileDB-Inc/TileDB/blob/dev/examples/cpp_api/aggregates.cc) should give you a good introductory example including ‘Sum’ and ‘Count’.

The ability is also being wrapped by the API packages so from R you can say (in the version in the repo)

```r
> uri <- "/tmp/tiledb/penguins"
> arr <- tiledb_array(uri)
> tiledb_array_apply_aggregate(arr, "year", "Count", FALSE)
[1] 344 # correct number of observations in the 'penguins' dataset
> 

```

Similar examples should work from the other APIs.

Feel free to chat to us in our slack or schedule a call to learn more.

Regards, Dirk

---

<div class="post-metadata">

**Author:** ![Scott\_Syms](https://yyz1.discourse-cdn.com/flex035/user_avatar/forum.tiledb.com/scott_syms/32/305_2.png) [@Scott\_Syms](https://forum.tiledb.com/u/Scott_Syms)\
**Post date:** [November 30, 2023, 9:44am UTC](https://forum.tiledb.com/t/quickly-determine-number-of-rows-in-your-database/642/3 "2023-11-30T09:44:02Z")

</div>

Thank you, @Dirk_Eddelbuettel

S
