Optimisation + View SQL + Rank attribute