database “冲突可序列化”和“冲突等价物”有什么区别?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/13823030/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 08:49:05  来源:igfitidea点击:

What is the difference between "conflict serializable" and "conflict equivalent"?

databaseconflictserializableequivalence

提问by taz

In database theory, what is the difference between "conflict serializable" and "conflict equivalent"?

在数据库理论中,“冲突可序列化”和“冲突等效”有什么区别?

My textbook has a section on conflict serializable but glosses over conflict equivalence. These are probably both concepts I am familiar with, but I am not familiar with the terminology, so I am looking for an explanation.

我的教科书有一节是关于可序列化冲突的,但忽略了冲突等价性。大概这两个概念我都很熟悉,但是我对术语不熟悉,所以我正在寻找解释。

采纳答案by fengd

Just two terms to describe one thing in different ways.

仅用两个术语以不同的方式描述一件事。

Conflict equivalent: you need to say Schedule A is conflict equivalent to Schedule B. it must involve two schedules

冲突等价:您需要说附表 A 与附表 B 的冲突等价。它必须涉及两个时间表

Conflict serializable: Still use Schedule A and B. we can say Schedule A is conflict serializable. Schedule B is conflict serializable.

Conflict serializable:仍然使用 Schedule A 和 B。我们可以说 Schedule A 是冲突可序列化的。附表 B 是冲突可序列化的。

We didn't say Schedule A/B is conflict equivalent

我们没有说 Schedule A/B 是冲突等价的

We didn't say Schedule A is conflict serializable to Schedule B

我们没有说 Schedule A 与 Schedule B 发生冲突

回答by letsBeePolite

Conflict in DBMS can be defined as two or more different transactions accessing the same variable and atleast one of them is a write operation.

DBMS 中的冲突可以定义为两个或多个不同的事务访问同一变量,并且其中至少一个是写操作。

For example:

例如:

T1: Read(X)   
T2: Read (X)

In this case there's no conflict because both transactions are performing just read operations.

在这种情况下没有冲突,因为两个事务都只执行读取操作。

But in the following case:

但在以下情况下:

T1: Read(X)   
T2: Write(X)

there's a conflict.

有冲突。

Lets say we have a schedule S, and we can reorder the instructions in them. and create 2 more schedules S1and S2.

假设我们有一个 schedule S,我们可以重新排列其中的指令。并创建另外 2 个计划S1S2.

Conflict equivalent: Refers to the schedules S1and S2where they maintain the ordering of the conflicting instructions in both of the schedules. For example, if T1has to read Xbefore T2writes Xin S1, then it should be the same in S2also. (Ordering should be maintained only for the conflicting operations).

冲突等效:指的是调度S1以及S2它们在两个调度中维护冲突指令的顺序。例如,如果T1有读取X之前T2XS1,那么它应该是在同S2也。(仅应为冲突的操作维护排序)。

Conflict Serializability: Sis said to be conflict serializable if it is conflict equivalent to a serial schedule (i.e., where the transactions are executed one after the other).

Conflict SerializabilityS如果冲突等同于串行调度(即,事务一个接一个地执行),则称其为冲突可串行化。

回答by Damodaran

From Wikipedia.

来自维基百科

Conflict-equivalence

冲突对等

The schedules S1and S2are said to be conflict-equivalent if the following conditions are satisfied:

如果满足以下条件,则调度S1S2被称为冲突等效:

  1. Both schedules S1and S2involve the same set of transactions (including ordering of actionswithin each transaction).

  2. The order of each pair of conflicting actions in S1and S2are the same.

  1. 两者都计划S1S2涉及相同的事务集(包括每个事务内的操作顺序)。

  2. 中的每对相互矛盾的动作的顺序S1S2是相同的。

Conflict-serializable

冲突可序列化

A schedule is said to be conflict-serializable when the schedule is conflict-equivalent to one or more serial schedules.

当调度与一个或多个串行调度发生冲突时,该调度被称为是冲突可串行化的。

Another definition for conflict-serializability is that a schedule is conflict-serializable if and only if its precedence graph/serializability graph, when only committed transactions are considered, is acyclic (if the graph is defined to include also uncommitted transactions, then cycles involving uncommitted transactions may occur without conflict serializability violation).

冲突可串行化的另一个定义是,当且仅当它的优先级图/可串行化图(当仅考虑已提交的事务时)是非循环的(如果该图被定义为还包括未提交的事务,则涉及未提交的事务的循环)时,调度是冲突可序列化的事务可能会在没有冲突可串行化违规的情况下发生)。

回答by Hari Chandu Vakacharla

If a schedule S can be transformed into a schedule S′ by a series of swaps of non-conflicting instructions, we say that S and S′ are conflict equivalent.

如果调度 S 可以通过一系列非冲突指令的交换转换为调度 S',我们说 S 和 S' 是冲突等价的。

We say that a schedule S is conflict serializable if it is conflict equivalent to a serial schedule.

如果调度 S 与串行调度等价的冲突,我们说调度 S 是冲突可串行化的。

回答by thirteenguy

Conflict Equivalent Schedules:if a Schedule S can be transformed into a schedule S' by a series of swaps of non conflicting instructions, we say that schedule S & S' are conflict equivalent.

冲突等价调度:如果调度 S 可以通过一系列非冲突指令的交换转换为调度 S',我们说调度 S & S' 是冲突等价的。

Conflict Serializable Schedule:Schedule S is conflict serializable if it is conflict equivalent to a serial schedule.

冲突可序列化调度:如果调度 S 与串行调度等价的冲突,则调度 S 是冲突可序列化的。

回答by benscabbia

Definitions have already been explained perfectly, but I feel this will be very useful to some.

定义已经被完美解释了,但我觉得这对某些人来说非常有用。

I've developed a small console program(on github) which can test any schedule for conflict serializability and will also draw a precedence graph.

我开发了一个小型控制台程序(在 github 上),它可以测试任何冲突可串行化的时间表,并且还会绘制一个优先级图。

回答by Pubudu Mahesh Meththananda

If there is at least one conflict equivalent schedule for considered transaction schedule, it is conflict serializable.

如果所考虑的事务调度至少有一个冲突等效调度,则它是冲突可序列化的。

回答by Aditya Guru

Conflict serializable means conflict equuivalent to any serial schedule.

冲突可串行化意味着冲突等同于任何串行调度。