SONAR-4923 Improve inheritance query management