# Is it recommended to have a clustering and partitioning for tables?

**URL:** <https://community.cratedb.com/t/is-it-recommended-to-have-a-clustering-and-partitioning-for-tables/401>\
**Category:** CrateDB\
**Created:** [May 21, 2020, 6:16pm UTC](https://community.cratedb.com/t/is-it-recommended-to-have-a-clustering-and-partitioning-for-tables/401 "2020-05-21T18:16:59Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![miguel.arregui](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/miguel.arregui/32/126_2.png) [@miguel.arregui](https://community.cratedb.com/u/miguel.arregui)\
**Post date:** [May 21, 2020, 6:16pm UTC](https://community.cratedb.com/t/is-it-recommended-to-have-a-clustering-and-partitioning-for-tables/401/1 "2020-05-21T18:16:59Z")

</div>

Is it recommended to have a clustering and partitioning for tables?

---

<div class="post-metadata">

**Author:** ![miguel.arregui](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/miguel.arregui/32/126_2.png) [@miguel.arregui](https://community.cratedb.com/u/miguel.arregui)\
**Post date:** [May 25, 2020, 7:34pm UTC](https://community.cratedb.com/t/is-it-recommended-to-have-a-clustering-and-partitioning-for-tables/401/2 "2020-05-25T19:34:01Z")

</div>

For tables that have a “stable” size - e.g. think of “master data” - partitioning doesn’t make so much sense.

For tables which are constantly growing, like time series data, partitioning is beneficial. One advantage is that you can adjust the number of shards for new partitions. Another that deleting whole partitions is cheap, compared to deleting individual documents.

Using a custom CLUSTERED BY column is for more advanced use-cases, where you have a good reason to use it.

Documentation on `partitions`:  
[https://crate.io/docs/crate/reference/en/latest/general/ddl/partitioned-tables.html](https://crate.io/docs/crate/reference/en/latest/general/ddl/partitioned-tables.html)  
[https://crate.io/docs/crate/reference/en/latest/sql/statements/create-table.html?highlight=clustered#partitioned-by](https://crate.io/docs/crate/reference/en/latest/sql/statements/create-table.html?highlight=clustered#partitioned-by)

Documentation on custom `clustered by`:  
[https://crate.io/docs/crate/reference/en/latest/sql/statements/create-table.html?highlight=clustered#clustered](https://crate.io/docs/crate/reference/en/latest/sql/statements/create-table.html?highlight=clustered#clustered)
