Validate a potentially expensive query without executing it.