I have a table in spanner the DDL is given below
CREATE TABLE orders_pii(
order_id STRING(64) NOT NULL,
retailer_id STRING(64) NOT NULL,
site_id STRING(64) NOT NULL,
shipping_labels ARRAY<STRING(MAX)>,
order_creation_timestamp TIMESTAMP NOT NULL,
order_stage_by_timestamp TIMESTAMP NOT NULL,
) PRIMARY KEY(order_id, retailer_id, site_id)
I read the documentation of spanner it says
Spanner automatically creates an index for each table's primary key. For example, you don't need to do anything to index the primary key
But in my case the primary key is combination of 3 columns So will the index be created for all three columns separately or directly the primary key which is combination of 3 columns.
Do I need to create the separate index for these 3 columns ?
One unique index will automatically be created for the three columns together. You do not need to manually add any additional indexes for that.