Add and drop hybrid table constraints online in Snowflake
You can now add and drop UNIQUE and FOREIGN KEY constraints on existing hybrid tables without recreating the table.
O que mudou
With this update, managing constraints on transactional tables is easier. Previously, modifying constraints on a hybrid table required recreating and reloading the entire table. Now, the operation runs online and in the background, keeping the table active for queries and writes.
Use cases
Imagine you need to add a foreign key to a production table handling thousands of concurrent requests without causing downtime.
- Add UNIQUE or FOREIGN KEY constraints to existing tables.
- Drop constraints without interrupting active applications.
- Validate new integrity rules without taking down the operational workflow.
How to use
Run the ALTER TABLE command to add the desired constraint:
ALTER TABLE player ADD CONSTRAINT fk_player_team
FOREIGN KEY (team_id) REFERENCES team (team_id);
What happens in this code:
- Snowflake starts building the required index in the background.
- The command returns before full completion to avoid blocking the workflow.
To track the progress of the index build, use the SHOW INDEXES command:
SHOW INDEXES;
What happens in this code:
- Snowflake lists the table indexes.
- The
statuscolumn displaysBUILD IN PROGRESSwhile the process runs andACTIVEwhen the constraint is ready.
Limitations and requirements
Generally available for accounts in AWS and Microsoft Azure commercial regions. If validation fails on existing rows during constraint addition, the statement succeeds, but the background build reports a validation failure status, enforcing the rule only for new writes.
- hybrid tables
- constraints
- foreign key
- alter table
- online ddl
Add and drop hybrid table constraints online (General availability)
Resumo e explicação gerados por IA a partir da release note oficial. Em caso de dúvida, a documentação oficial da plataforma prevalece.
Relacionadas
- SnowflakeGA
Geração de documentos em PDF, Word e PowerPoint no Snowflake CoWork
O Snowflake CoWork agora gera arquivos PDF, Word, PowerPoint e HTML diretamente de suas análises usando a ferramenta de execução de código do Cortex Agent.
snowflake cowork · cortex agent - SnowflakePublic Preview
Cortex Agent SDK para Python e TypeScript no Snowflake
O Cortex Agent SDK permite criar aplicações que utilizam Cortex Agents e Cortex Code em Python e TypeScript.
cortex agents · python - SnowflakeAtualização
Mensagens de erro mais detalhadas na classificação de dados sensíveis
A view DATA_CLASSIFICATION_LATEST agora traz mensagens de erro específicas e códigos do Snowflake para falhas na classificação.
data governance · trust center