ricardo_murad: preserve query order