Getting Started
Make sure to first set up your PlanetScale developer environment. Once you’ve installed thepscale CLI, you can interact with PlanetScale and manage your databases straight from the command line.
The lookup-vindex command
Run Vitess LookupVindex on a Vitess database branch. Use it to create and backfill a Lookup Vindex for a table that already has data.
create starts a VReplication backfill. Until you externalize, Vitess keeps the lookup table in sync with VReplication. After you externalize an owned Lookup Vindex, writes to the owner table update the lookup table in the same transaction. See the Vitess Creating a LookupVindex guide for background.
Usage:
pscale branch vtctld lookup-vindex also works.
You must be an Organization Administrator or a Database Administrator of the database to create and change Lookup Vindexes. Service tokens need
read_workflow to show a Lookup Vindex, write_workflow to create, externalize, internalize, or complete one, and delete_workflow to cancel one.Available sub-commands
* Flag is required
Sub-command flag descriptions
Available flags
Global flags
Lifecycle
- Create the Lookup Vindex and wait for the backfill to finish (
show). - Externalize so Vitess can use it for routing.
- Complete after externalization, or internalize if you need to resume backfill.
- Cancel to abandon creation before you finish.
Examples
API
Matching API paths under/v1/organizations/:org/databases/:db/branches/:branch/lookup-vindex/vindexes.
For VSchema concepts, see Vindexes and Alter VSchema.

