Fix quota calcuation query.

[#80639978].