Issue Details (XML | Word | Printable)

Key: CORE-2672
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Vlad Khorsun
Reporter: Vlad Khorsun
Votes: 0
Watchers: 0

If you were logged in you would be able to see more operations.
Firebird Core

Reduce precedence writes

Created: 09/Oct/09 08:38 PM   Updated: 24/May/16 04:03 PM
Component/s: Engine
Affects Version/s: None
Fix Version/s: 2.5 RC1

QA Status: Cannot be tested

 Description  « Hide
Below is simplified description of how update is performed by the engine.

At first, update must read the record.
If record have backversion and backversion is ready to be garbage collected it must be erased.
Let primary page number is A and backversion page number is B.
Deletion of backversion creates dependency in precedence graph : A -> B, i.e. page A must be written after page B (as we just cleared backpointer at primary record version).
Then update must create and store new backversion. With high probablity it will be stored again on page B.
This create second dependency B -> A.
To prevent circle in precedence graph such case requires to write page A on disk clearing its dependencies.
This is so-called precedence write.
So, in the worst case we will write pages on disk for every updated record which make mass update performance terrible slow.

The likely issue happens if when engine performs update_in_place (for example second update of the same record in the same transaction).

 All   Comments   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Vlad Khorsun added a comment - 09/Oct/09 08:42 PM
The offered solition is to search for page B in precedence graph before storing backversion and choose another page to not create circle in precedence graph and avoid precedence write.