Delete useless joins