query upgrade