If it helps, I work with children and I work with older children the longest because they can be very traumatised mainly because of the severed attachments (whether good or bad it hurts a lot and when in a tug of war between parents can lead to all sorts of problems if unresolved).
If you are going to leave it will be much better for both you and your child the younger the child.