FOR KEY SHARE - 什么是'key values'? [英] FOR KEY SHARE - what are 'key values'?

查看:52
本文介绍了FOR KEY SHARE - 什么是'key values'?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文档说明

密钥共享锁会阻止其他事务执行 DELETE 或任何更改密钥值的 UPDATE.

A key-shared lock blocks other transactions from performing DELETE or any UPDATE that changes the key values.

键值"是指主键、唯一键、索引键或用于 SELECT 查询的列吗?

Does "key values" refer to the primary key, or the unique keys, or the indexed keys, or the columns used for the SELECT query?

推荐答案

术语键值指的是外键.

Alvaro Herrera,Postgres 9.3 补丁的作者写道(根据 这个来源):

Alvaro Herrera, the author of the patch in Postgres 9.3 wrote (per this source):

外键触发器现在使用 FOR KEY SHARE 而不是 FOR SHARE;这意味着并发改进适用于它们,这是整体这个补丁的要点.

Foreign key triggers now use FOR KEY SHARE instead of FOR SHARE; this means the concurrency improvement applies to them, which is the whole point of this patch.

您还可以在文档中找到此提及:

目前,为 UPDATE 案例考虑的列集是那些具有唯一索引的列,可以在外键中使用(因此不考虑部分索引和表达式索引),但这在未来可能会改变.

Currently, the set of columns considered for the UPDATE case are those that have a unique index on them that can be used in a foreign key (so partial indexes and expressional indexes are not considered), but this may change in the future.

这篇关于FOR KEY SHARE - 什么是'key values'?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆