Transaction B+ Tree:
Transaction is a set of logically related instructions to perform logical unit of [Link] Internal Node: 𝑃 × 𝐵! + (𝑃 − 1)𝐾 ≤ 𝐵𝑙𝑜𝑐𝑘 𝑆𝑖𝑧𝑒 , Leaf Node: 𝑃4𝐾 + 𝑅! 6 + 𝐵! ≤ 𝐵𝑙𝑜𝑐𝑘 𝑆𝑖𝑧𝑒 ,
properties of transaction. Atomicity – atomic unit of processing, it should be performed in its Where P= Max Pointers or keys can fir in one node, 𝐵! = Block Pointer Size, K= key Size, 𝑅! =
entirity or not at all Consistency – transaction should be consistency, preserving, meaning if it is Record Pointer Size
completely executed from beginning to end without interference from other transaction, it should Max Key = P-1 ,
take the database from one consistent state to another. Isolation – a transaction should appear as Min Key = ⌈𝑃/2⌉ − 1 , if Leaf Node then Min Key = ⌈𝑃/2⌉
though it is being executed in isolation from other transaction, even though many transactions are
Query Cost Evaluation
executing councurrently. Durability - the changes to the database by committed transaction must
Query cost evaluation is used to estimate the cost of executing a query so that the DBMS can
persist in the database
Transaction state choose the most efficient query execution plan. Disk Access Cost - Disk I/O is the most dominant
Active – it is an initial state transaction remains in the state while it is executing operations cost in query processing. It includes: Number of disk block reads , Number of disk block writes. #
Since disk operations are much slower than memory operations, minimizing disk I/O greatly
Partially committed – after the final statement has been executed. The state of transaction is
partially committed as it is still possible that it have to be aborted Aborted - A transaction is said to improves query performance. CPU Cost - CPU cost refers to the processing time required by the
be in aborted state when the transaction has been rolled back and database has been restored to CPU to execute operations such as: Comparing tuples , Performing joins , Sorting , Evaluating
its prior to the start of execution conditions , Although smaller than disk cost, it still contributes to overall query execution time.
Schedule Memory Usage - Memory cost refers to the amount of main memory required during query
When two or more transaction executed together or one after another then they can be bundled execution. Efficient use of memory reduces the need for additional disk access and speeds up query
up into a higher unit of execution called schedule. processing. Communication Cost - In distributed databases, communication cost represents the
cost of transferring data across the network between different database sites. Reducing data
Serial Schedule - A serial schedule consiste of sequence of instructions belonging to different
transfer helps improve query performance.
transactions, where instructions appear together Before complete execution of one transaction
another transaction can’t be started. Every serial schedule lead database into consistent state.
Non Serial Schedule - A schedule in which sequence of instructions of an transaction appears in the
same order as they appear in individual transaction but the instructions may be interrelated with
the instruction of different transactions.
Conflict Equivalent – if one schedule can be converted to another schedule by swapping of non-
conflicting instruction then they are called Conflict Equivalent schedule
Conflict Serializable - The schedules which are conflict equivalent to a serial schedule are called
conflict serializable schedule. 2) if a schedule S can be transformed into schedule s’ by a series of
swaps of non conflicting instructions, we say that S and S’ are conflict equivalent. A Schedule S is
conflict serializable , if it is conflict equivalent to a serial schedule
View Serializable - If a schedule is not conflict serializable, still, it can be consistent using a weaker
form of serializability called View serializability, and if a schedule is view serializable, still, it can be
consistent. Two schedule S and S’ are view equivalent if they satisfy following conditions.
Same initial Reads – if a transaction reads the original(initial) value of a data item in schedule S, it
must also read the original value in S’ Same Reads from Writes – if a transaction reads a value
written by another transaction in schedules it must read the value from transaction in schedule S’ .
Same Final writes – The transaction that performs the final wite on any data item in schedule S
must also perform the final write in schedule S’ .
Specialization : it is the process of dividing a higher-level entity into lower-level sub-entities
(subclasses) based on distinguishing characteristics. It Highlights similarities among lower level
entity set while hiding diffrences.
Generalization: it is the opposite of specialization. It combines multiple entities with similar
attributes into a higher-level entity (superclass).This top down Approach delineates complexity into
simpler components
Inheritance : In EER diagrams, subclasses inherit the attributes and relationships of their superclass.
# Ex:PERSON (Name, Age)----STUDENT (RollNo) The STUDE entity inherits Name and Age from PERS
Aggregation: it is used when a relationship itself needs to be treated as an entity so it can
participate in another relationship, enabling a more organised representation of complex relations