# Partitioning strategy

**URL:** <https://community.cratedb.com/t/partitioning-strategy/1831>\
**Category:** CrateDB\
**Tags:** fundamentals\
**Created:** [August 14, 2024, 8:43pm UTC](https://community.cratedb.com/t/partitioning-strategy/1831 "2024-08-14T20:43:36Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![bfmcneill](https://avatars.discourse-cdn.com/v4/letter/b/ba9def/32.png) [@bfmcneill](https://community.cratedb.com/u/bfmcneill)\
**Post date:** [August 14, 2024, 8:43pm UTC](https://community.cratedb.com/t/partitioning-strategy/1831/1 "2024-08-14T20:43:36Z")

</div>

Hello,

I have ~30 Million records that could be naturally partitioned into months. that would create around36 partitions. I am running crate on a 2 node cluster. each node has 32gb ram and 2 cpu w/ 8 cores per cpu.

is it a bad id idea to do 2 shards per partition on that table?

the 32 million is my fact table but the dimension tables are much smaller, do i give those 1 shard and not partitioning?

---

<div class="post-metadata">

**Author:** ![hernanc](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/hernanc/32/676_2.png) [@hernanc](https://community.cratedb.com/u/hernanc)\
**Post date:** [August 15, 2024, 7:18am UTC](https://community.cratedb.com/t/partitioning-strategy/1831/2 "2024-08-15T07:18:17Z")

</div>

Hi,  
If shards are too small performance will not be optimal, so this depends a bit on how large your typical records are, but it sounds a bit like you would end up with too many shards for the size of the table.  
Also please note that a 2 nodes cluster will not give you HA, for HA we need a minimum of 3 nodes.  
Take a look at [Sharding and Partitioning (cratedb.com)](https://cratedb.com/docs/guide/admin/sharding-partitioning.html) for further details.

---

<div class="post-metadata">

**Author:** ![bfmcneill](https://avatars.discourse-cdn.com/v4/letter/b/ba9def/32.png) [@bfmcneill](https://community.cratedb.com/u/bfmcneill)\
**Post date:** [August 15, 2024, 8:00am UTC](https://community.cratedb.com/t/partitioning-strategy/1831/3 "2024-08-15T08:00:23Z")

</div>

The entire dataset is 10GB of json files. When loaded on to crate the table shows 30 Million records ~ 6GB. Perhaps I only want 1 shard?

Regarding HA thanks for the remark. I am a bit new.

I noticed that queries are really fast on a single table but joins are really slow so I’m trying to see if there is an option to speed it up.

---

<div class="post-metadata">

**Author:** ![hernanc](https://sea2.discourse-cdn.com/flex020/user_avatar/community.cratedb.com/hernanc/32/676_2.png) [@hernanc](https://community.cratedb.com/u/hernanc)\
**Post date:** [February 6, 2025, 2:42pm UTC](https://community.cratedb.com/t/partitioning-strategy/1831/4 "2025-02-06T14:42:22Z")

</div>

Hi, yes, for 6 GB you may want 1 shard.

> joins are really slow

Could you share some details on the kind of JOINs you are doing? we got significant improvements to JOINs performance in CrateDB 5.8
