Improve AX performace by fixing bad Query plans

Sometimes the Purchase invoicing department has complained that posting took […]