Branching impact and hierarchy

Your documentation says that branching uses copy on write and you’re saying it doesn’t have any impact on the main branch load. But if a branch is created on top of main branch and then a millions records are deleted from main branch, aren’t they copied to all branches created on top of main branch ? Are they just not seen anymore for main branch but seen by other branches ? and when/what does the copy of those records to the corresponding branch to avoid losing them ?

Also all your examples show branches created on top of main branch. Can branches be created on top of other branches ? I suppose it slow down I/Os as they need to read through parents if a page is not found ?

But if a branch is created on top of main branch and then a millions records are deleted from main branch, aren’t they copied to all branches created on top of main branch

No, changes made in the point-in-time recovery window are essentially stored only as the change data.

Are they just not seen anymore for main branch but seen by other branches ?

So if I modify the main branch, this doesn’t change the data we store for other branches. But, once the PITR window elapses for those changes on the main branch, we do need to store a new copy of the changed data in the main branch.

Also all your examples show branches created on top of main branch. Can branches be created on top of other branches ?

Yes, this is possible.

I suppose it slow down I/Os as they need to read through parents if a page is not found ?

Those branches are not significantly more expensive, as our search for how we find data is also based on COW data structures which efficiently index where to find the necessary data to create the correct page version.

I suspect it might become an issue if you create branches of branched branches more frequently than when you make significant changes in these databases. Still, you will likely hit usage limits before it becomes a performance bottleneck.