DB: How to draw a precedence graph (rules + 3 examples)
Вставка
- Опубліковано 10 лют 2025
- From the conversation with Adi Nagara@3rd example:
You have indeed no global cycle of all transactions. But you have a cycle in T1,T2. You could indeed say, that {T1, T2} (as one entity) and {T3} is conflict serializable.
Though, in this example I don't look at it in that way. My statement of "conflict serializable" / "not conflict serializable" refers to all transaction. So I mean "all transaction are conflict serializable" or "all transactions are not conflict serializable".
If you're concerned about exams, you should ask your teacher in which way he wants the statement to be.
Comment from TNH91 (didn't verify this content yet):
"If two different transactions contain at least one write and one (read/write) on the same field, then draw an arrow from the earlier to the later."
Video erstellt mit HyperCam2
You explained 80% of required transaction knowledge for my retake in less than 8 minutes while my teacher was only reading slides and required us to draw these graphs without explaining a bit. Thank you so much! I hope I will pass tomorrow!
same thing here!
I am cooked
This was a bit clearer to me than the wikipedia entry on the same thing. Mostly because the explanation on Wikipedia is a bit convoluted, but the drawing of the arrows straight onto the visualised stories was an excellent aid as well. More succinctly: If two different transactions contain at least one write and one (read/write) on the same field, then draw an arrow from the earlier to the later.
You made this concept so clear and easy to understand for me . THANK YOU!
Thanks for your crystal clear explanation. You saved my life
Man, thank you so much, just for some mins I already get it, the way you teach help me a lot, thanks
all the best wishes to u and your friends and familly. u saved my ass before tommorow`s exam. thx a lot
the simpliest and the best explaination of the youtube
this was condensed and so clear so on point. Perfect.
Thank you. Simplest and best Explanation.
Thank you Thank you Thank you Thank you Thank you Thank you Thank you BLESS YOU SIR
very direct and straight to the point
Thank u so much. You explained so well so effortlessly understood! great job!
Please post more videos like this covering other related subjects. This is way better than my lecturers explanation
I'm glad I could help :)
Thank you sir, it's very clear to understand.
Thanks a ton tomorrow I have my exam thanks a lottttt
Thank you so much man🤩whole explanation within few minutes🔥🔥
Thanks a lot for this short and wonderful explanation ❤
Absolute hero. Thank you!
AWesome bro, awesome. Thanks that you exist!
Short and precise thanks mate
Thank you for helping to do my in class assignment ❤❤
Great explanation!
You make it easy!. Thanks from heart!
Finally an IT video without an Indian accent. Can't listen to that accent anymore 😂
Get ready for "can't listen to German accents anymore" :D // Thanks for your comment above
hahahahah jero divided by 1 is jero
Common dude people are just trying to help :) You don't have to be mean. After all its for the sake of learning. For a constructive purpose.
@@lerneninverschiedenenforme7513 But I've got to say, your accent is barely noticeable/recognizable as a German one. At least not compared to the usual German accent. I honestly had a hard time figuring out where you come from (until I saw your channel name of course).
@@Dosenwerfer Thank you :) I'm glad I can hide it :)
Best video for PG , Boss.. Thanks
Got more clear idea about precedence graphs.thank you
A semester worth of knowledge
Best explanation 💯
Thanks!
5:03 why didn't you take T1: W(B) and T3:W(B) as a conflict. It's on the same object, it's a Write and it's different transactions. Am I missing something?
Eagle mind! Indeed you're right, that is also conflicting.
I guess I missed it, because the T1:W(B) did already have an arrow.
However, the final result does not change.
It's more clear 🙌🏻🙌🏻🙌🏻
Thanks for wonderful explanation
Thanks you for this valuable video❤❤❤
sehr nutzlich video, er hilft mir in meine prufung, Vielen Dank und tut mir leid fur meine schlechte Deutsch
Awesome explanation, thank you !
Thank you for amazing explanation
so cool! solved my questions in 30 sec
fire bro, thank u for this
Man. this is so helpful thank you !!!!!!
Excellent !!
what, my prof takes 2 class (6 hours) to explain this and I still don't understand but you can explain them in 8 mins video !!
Man! This is awesome! Thanks! Better than my prof... is there any more? About Xact and especially QEval?
Thanks. clearly explain.. ❤
Hello, I would like clarify something in the third example you gave... It seems to me that there is no cycle in the graph, therefore the transactions are in fact conflict serializable. In any case, thank you for sharing!
Why do you think there is no cycle? :)
ah! Now I think I understood, what you're talking about. Very precise! You have indeed no global cycle of all transactions. But you have a cycle in T1,T2. You could indeed say, that {T1, T2} (as one entity) and {T3} is conflict serializable. Well spotted :)
Though, in this example I don't look at it in that way. My statement of "conflict serializable" / "not conflict serializable" refers to all transaction. So I say "all transaction are conflict serializable" or "all transactions are not conflict serializable".
If you're concerned about exams, you should ask your teacher in which way he wants the statement to be.
does this solve your question?
Thank you for the clarification. Look forward to more videos to come!
:) Thank you for looking with a detailed eye!
It was really helpful.. but if you could talk about the degree and order of the graph that would have been absolutely awesome!
Urm why are you better than my lecturer, whom i pay NINE THOUSAND POUND FOR . Thank you
I have no idea, but feel free to send that money to me :)
I'm glad I could help :)
This was easy to understand thank you
Thank you so much! This was very helpful.
Thank you so much !
thankyou so much!
Thank You So Much
Very halpfull 😍 thank youuuuu
In second example at 4:12 we need not to connect t1 read(a) To t2 write(a) as t1 has committed before this write yet the transaction is conflict serializable
I learned it in a way, that commits do not matter in this regard. Can you name sources, that say you need to take the commit into account?
@@lerneninverschiedenenforme7513 then I request you to plz tell the function of this commit in transaction
Meenakshi Samg TBH I'm totally with you here, regarding logic. I don't know the background why, but the commit should be ignored. I advice you to compare it to your other sources.
I also advice you to use a different language "I request you" would be better off as "I'd like to ask you...". The former is not too suitable here.
was very helpful. cheers!
What if there was a cycle between 2 transactions T1 and T2 but of different data items? Will it still be conflict serializable?
Can we say, at 5:50, not conflict serializable, if the T1 to T2 reversed? say if the arrow direction is from T2 to T1?
That's basically what's happening in example 3 ( 7:18 ); So, yes
in the last example why do you say it is non conflict serializable? T1,T3,T2 does not complete a full cycle, but T1 and T2 does.
As far as I remember: As soon as there is *any* cycle, it becomes "not conflict serializable"
@@lerneninverschiedenenforme7513 not it is not right , please check , I mean we need to consider all three transaction are making cycle or not , please check and inform me
thank u so much !
Thank you
THANK YOUU
I like your explanation. Just one question: Why should we ignore the commits in 5:25 ?
Thank you. Tbh, I don't know why. I just figured, you need to. I think it might make sense in a real-life situation with a slightly broader view on the topic. But I can't say for sure.
i just want to know that if their is any cycle is available then their is no conflict serializable. if their is no. of cases then what happened such as T1, T2, T3, T4, T5 then how we defined it for non conflict or conflict serializable?
I love you sir
thanks😀
But how does this method deal with dirty reads (transaction where your read it from aborts and resets value)? In practical situations you can't know from before if a transaction will commit or abort.
I can't give an educated answer to this question.
I would foolishly assume, that this model doesn't care about dirty reads.
You did not explain those with Abort in it.
Great video. but I still have a queation, you said we dont need to care about commit, what about abort. For example, we have a schedule, T1:W(x),T2:R(x),T1:W(x), T2:abort,T1:commit. Is this schedule conflict-serializable or not.
See Answer from Shubham Gupta's question from two days ago :)
spoiler alert: it did help
why would you ignore the commit? After a transaction commits it cannot be in conflict with other transactions
TBH, I don't know why. I just figured, you need to. I think it might make sense in a real-life situation with a slightly broader view on the topic. But I can't say for sure.
If you have 3 nodes in total but there is a cycle between T1 and T2, does the same rule apply? I mean is it still not conflict serializable even though there is an '''''empty'''' node?
That's basically what's happening in example 3 (7:10). Except, that the "empty" one is also refered. But that does not change the situation.
it helped tnx
my man
Why are you not taking W-W operation? Please clear my doubt...I am new to this topic!It will be helpful for me!
I should. What time of the video are you talking about?
You are supposed to take any operation which is applied on the same object where both are in different transactions AND there's at least one write operation. If you are referring to the first example, he wasn't taking the W-W operation because one transaction was applied to X while the other was applied on Y. And thats irrelevant.
Hey!
What would you say about the following schedule?
R1(X)R2(Y)R3(Z)W1(X)W3(Z)C1W2(X)W2(Y)C2R3(Y)W3(Y)C3
I got in my assignment and I'm quite confused about whether it conflicts serializability or not..
Yes, it is conflict serializable. There are no cycles between T1, T2 and T3. The graph would be T1->T2->T3.
I didnt get why 1st example not conflict serializble but the 2nd one ?
In the first example you have a circle (the arrows form a circle). In the second one not.
What happens if read and write is executed on the same data at the same time from two different transactions?
I can't answer this question.
Actually an interesting question. I guess the question is too advanced, so universities do not handle it...?
how can i find the schedule if i have the graph?
Sorry, but unfortunately I can't help you with that. I'd say in one case, you can do them in parallel and in the other one you have to do them one after another. ← this might be correct, but I didn't think it through. You should check again, somewhere else.
Behold our god
can you please help me to solve an exercise please? how can I send it to you plz plz
how to draw the precedence graph for this:
R1(A) R4(A) R4(B) R3(A) R3(B) R2(A) R2(B) R3(C) W1(A) R1(B) W1(B) W4(A) W4(B) W3(A) W3(C)
my solution is:
T1 go to T3 and T4
T2 go to T1 and T3 and T4
T3 go to T1 and T4
T4 go to T1 and T3
is it correct?
Can you upload an image , that shows transaction and actions (R/W) as in the video. Can you also draw the arrows as in the video?
@@lerneninverschiedenenforme7513 thank you for your reply,
here is the exercise:
www.dropbox.com/s/9tv8ypnbwo5nafs/Exercise.pdf?dl=0
and here is the solution of the first question
www.dropbox.com/s/9tv8ypnbwo5nafs/Exercise.pdf?dl=0
I want to know if it is correct, and if you can help me to understand and solve the rest. thank you very much.
ps: the exercise was translated from french to english so, I hope u understand my translation.
@@lerneninverschiedenenforme7513 so?
@@you-td9sl You linked the same document twice. Your answer is not included. I would say it's not conflict serializable, as there is a cycle between T1 and T4; T3 and T4; T1 and T3; T1 and T3 and T4; ...
@@lerneninverschiedenenforme7513 oh sorry, here is it:
www.dropbox.com/h?preview=transaction.jpg
it's not serialisable, check the answer and correct me plz if it is not correct.
I love you
t1 V t2 is conflict serializable. not, non-conflict serializable.
right/
Why do you think so?
Ok bro
you beauty
there isn't a cycle
We taught damned algorithm which made so sense.
Thank you very much for this!!! ❤
I think college's sole purpose is to make our lives complicated by making simple things complex! 🥲