728x90
3๏ธโฃ How to Test Serializability
Testing for Conflict Serializability
Precedence graph์ Cycle ์ ๋ฌด๋ฅผ ๊ฒ์ฌ
- a direct graph where the vertices are the transactions
- We draw an arc from Ti to Tj if the two transactions conflict, and Ti accesses the data item on which the conflict arises earlier
- we may label the arc by the item that is accessed
- Node : ํธ๋์ญ์ , Edge : ์ถฉ๋์ฐ์ฐ ์์ ๋ ๋ฐ์ดํฐ๋ฅผ ๋จผ์ ์ฝ๋ ๋ฐฉํฅ์ผ๋ก.
⇒ ๋ง์ฝ ์ฌ์ดํด ์กด์ฌ? conflict serializable ํ์ง ์์ -(cycle์ด ์์ด์ผ ํจ)
Precedence Graph
[Example 1]

์ฌ์ดํด ์กด์ฌ → ์ถฉ๋ ์ง๋ ฌ ๊ฐ๋ฅ ์ค์ผ์ค์ด ์๋
[Example 2]

์ฌ์ดํด ์กด์ฌํ์ง ์์ → Conflict Serializable Schedule
Cycle Detection
์ฌ์ดํด ๊ฒ์ฌ๋ N^2 ๋๋ N+E ์ ์๊ฐ ๋ณต์ก๋๋ก ๊ฐ๋ฅ (N = ์ ์ ์, E = ๊ฐ์ ์)
๋ง์ฝ ๊ทธ๋ํ๊ฐ ๋น์ํ์ ? → topological sorting(์์์ ๋ ฌ)์ ํตํด serializableํ๊ฒ ๋ง๋ค ์ ์์
Test for View Serializability
NP-complete ๋ฌธ์ ์ด๋ฏ๋ก precedence ๊ทธ๋ํ๋ก ํ๋จํ ์ ์๋ค.
728x90
'๐ฉ๐ปโ๐ป CS > Database' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
| [DB/2-1. Lock-based Protocols] (1) | 2024.03.30 |
|---|---|
| [DB/1-4. Recoverability(ํ๋ณต ๊ฐ๋ฅ)] (0) | 2024.03.27 |
| [DB/1-2.Serializability(์ง๋ ฌ์ฑ)] (1) | 2024.03.24 |
| [DB/1-1. Transaction(ํธ๋์ญ์ )] (0) | 2024.03.18 |