Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ mysql> vexplain select * from corder where sku = "Product_1";
"Values": [
":sku"
],
"Vindex": "binary_md5"
"Vindex": "xxhash"
},
{
"OperatorType": "Route",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,8 @@ the primary [vindex type](../../../reference/features/vindexes/#predefined-vinde
way of distributing rows into various shards. For other data types we would typically use a different vindex
type:

* For `VARCHAR` columns, use `unicode_loose_md5` or `unicode_loose_xxhash`.
* For `VARBINARY`, use `binary_md5` or `xxhash`.
* For `VARCHAR` columns, use `unicode_loose_xxhash`.
* For `VARBINARY`, use `xxhash`.
* Vitess uses a plugin system to define vindexes. If none of the
[predefined vindexes](../../../reference/features/vindexes/#predefined-vindexes) suit your needs, you can
develop your own custom vindex.
Expand Down
12 changes: 6 additions & 6 deletions content/en/docs/21.0/user-guides/sql/vtexplain.md
Original file line number Diff line number Diff line change
Expand Up @@ -78,11 +78,11 @@ The following example VSchema defines a single keyspace `mainkeyspace` and three
"mainkeyspace": {
"sharded": true,
"vindexes": {
"hash": {
"type": "hash"
"xxhash": {
"type": "xxhash"
},
"md5": {
"type": "unicode_loose_md5",
"unicode_loose_xxhash": {
"type": "unicode_loose_xxhash",
"params": {},
"owner": ""
},
Expand All @@ -101,7 +101,7 @@ The following example VSchema defines a single keyspace `mainkeyspace` and three
"column_vindexes": [
{
"column": "user_id",
"name": "hash"
"name": "xxhash"
},
{
"column": "name",
Expand All @@ -115,7 +115,7 @@ The following example VSchema defines a single keyspace `mainkeyspace` and three
"column_vindexes": [
{
"column": "name",
"name": "md5"
"name": "unicode_loose_xxhash"
}
],
"auto_increment": null
Expand Down
8 changes: 4 additions & 4 deletions content/en/docs/21.0/user-guides/vschema-guide/sharded.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ A sharded keyspace allows you to split a large database into smaller parts by di

Vitess provides many predefined vindex types. The most popular ones are:

* `hash`: for numbers
* `unicode_loose_md5`: for text columns
* `binary_md5`: for binary columns
* `xxhash`: for numbers
* `unicode_loose_xxhash`: for text columns
* `xxhash`: for binary columns

In our example, we are going to designate `customer` as a sharded keyspace, and create a `customer` table in it. The schema for the table is as follows:

Expand Down Expand Up @@ -59,7 +59,7 @@ alter vschema on customer.customer add vindex hash(customer_id) using hash;
The DDL creates the `hash` vindex under the `vindexes` section, the `customer` table under the `tables` section, and associates the `customer_id` column to `hash`. For sharded keyspaces, the only way to create a table is using the above construct. This is because a primary vindex is mandatory for sharded tables.

{{< info >}}
Every sharded table must have a Primary Vindex. A Primary Vindex must be instantiated from a vindex type that is Unique. `hash`, `unicode_loose_md5` and `binary_md5` are unique vindex types.
Every sharded table must have a Primary Vindex. A Primary Vindex must be instantiated from a vindex type that is Unique. `xxhash`, `unicode_loose_xxhash` and `binary_md5` are unique vindex types.
{{< /info >}}

The demo brings up the `customer` table as two shards: `-80` and `80-`. For a `hash` vindex, input values of 1, 2 and 3 fall in the `-80` range, and 4 falls in the `80-` range. Restarting the demo with the updated configs should allow you to perform the following:
Expand Down