Skip to main content

What this error means

UNSUPPORTED_SHARDED_FEATURE means the schema uses a feature that is valid in some MySQL or unsharded Vitess schemas but not in a sharded keyspace. Common messages include:

Why PlanetScale rejects it

In a sharded keyspace, rows are distributed across multiple MySQL instances. Features that require one local MySQL instance to understand the entire table, such as AUTO_INCREMENT, cannot coordinate safely across shards. Views are also not supported in sharded keyspaces.

How to fix it

For AUTO_INCREMENT columns, use a Vitess sequence table instead:
Then create a sequence table in an unsharded keyspace and update the VSchema to use it.
For views in sharded keyspaces, remove the view from the sharded keyspace. Move the logic into application queries, materialize the data into a table, or use an unsharded keyspace when appropriate.

Need help?

Get help from the PlanetScale Support team, or join our Discord community to see how others are using PlanetScale.