[Question posted by a user on YugabyteDB Community Slack]
Does the ysql_num_tablets
G-flag replace the ysql_num_shards_per_tserver
G-flag?
ysql_num_tablets
seems to be currently absent from the online documentation.
[Question posted by a user on YugabyteDB Community Slack]
Does the ysql_num_tablets
G-flag replace the ysql_num_shards_per_tserver
G-flag?
ysql_num_tablets
seems to be currently absent from the online documentation.
All gflags are explained also in the source code. ysql_num_tablets
is explained here https://github.com/yugabyte/yugabyte-db/blob/b5aa25686b8444d171bd8d89c57342bf4e5b12a7/src/yb/client/client.cc#L220.
It defines the "total" number of tablets for a table or index cluster-wide. While ysql_num_shards_per_tserver
defines the number of tablets for each yb-tserver.
expanding on the answer given already, so if your ysql_num_tablets = -1 (default), then
number of tablets = ysql_num_shards_per_tserver * number of tservers you have.
If however, during your DDL statement to create the table you have already specified the number of tablets then that takes precedence over these params. Here is an example of creating a table with two columns odd and even - with 5 shards.
Then if you want to insert data