Optimise db branch