Swap order of 'and' clause. The Hash type checking is very trivial compared to the calculation of columns_hash, which appears to use a query.