Will a Partitioned Table in YugabyteDB Also Be Sharded?

Distributed SQL Tips and Tricks
Marko Rajcevic

Yes, regardless if you partition it or not, every table and index in YugabyteDB will be sharded across your cluster. Think of every partition as a single table, because that is how YSQL looks at it.

Partitioning and sharding are separate concepts in YugabyteDB that can be used together to configure unique concepts such as row-level geo-partitioning for multi-region workloads.

As described in Distributed SQL Essentials: Sharding and Partitioning in YugabyteDB, partitioning in YugabyuteDB is at the query level (YSQL), while sharding is at the storage level (DocDB).

If you want to prove this, follow an example in our partitioning documentation. Once the partitions are created, go to https://<ip>:9000 and click on the Tablets tab to see all of the tablets created.

You can also use the following yb-admin command based on the example in the docs:

yb-admin --master_addresses <ip1>:7100,<ip2>:7100,<ip3>:7100 list_tablets ysql.yugabyte order_changes_2019_02

Discover More Tips and Tricks

A library of distributed SQL tips and tricks and general “how to” information can be found by searching the YugabyteDB blog, as well as our DEV Community Blogs.

Events and Training

Check out the upcoming YugabyteDB events, including all training sessions, conferences, in-person and virtual events, and YugabyteDB Friday Tech Talks (designed for engineers by engineers).

In addition, there is some extremely popular “how to” content on the YugabyteDB YouTube channel.

If You Have Questions About Distributed SQL

If you have questions, make sure to ask them on the YugabyteDB Slack channel, Forum, GitHub, or Stack Overflow.

Next Steps

Ready to start exploring YugabyteDB features? You have some great options to get started. Run the database locally on your laptop (Quick Start), deploy it to your favorite cloud provider (Multi-node Cluster Deployment), sign up for a free YugabyteDB Managed cluster, or request a full-featured trial. It’s easy! Get started today!

Marko Rajcevic

Related Posts

Explore Distributed SQL and YugabyteDB in Depth

Discover the future of data management.
Learn at Yugabyte University
Get Started
Browse Yugabyte Docs
Explore docs
PostgreSQL For Cloud Native World
Read for Free