**Use case**

Please look at the next request:
```
SELECT * FROM numbers(1000000) WHERE number % 10000 == 0 and extremely_heavy_udf(number) == 'ok'
```
Now as far as all the functions are "eager" the heavy UDF will drastically reduce performance of the request. 

**Describe the solution you'd like**

As far as I understood after a conversation with @alexey-milovidov you have a "Short Circuit Processing" optimization for simple logical predicates (like conjunctive normal form) doing "lazy calculate" for heavy functions.

So it would be nice to assume all UDF functions as heavy-to-process (which is very close to the truth).

{
    wait_called = true;
    in.close();
    out.close();
    err.close();
    LOG_TRACE(getLogger(), "Will wait for shell command pid {}", pid);
    int status = 0;
    while (waitpid(pid, &status, 0) < 0)
    {
        if (errno != EINTR)
            throwFromErrno("Cannot waitpid", ErrorCodes::CANNOT_WAITPID);
    }
    LOG_TRACE(getLogger(), "Wait for shell command pid {} completed with status {}", pid, status);
    if (WIFEXITED(status))
        return WEXITSTATUS(status);
    if (WIFSIGNALED(status))
        throw Exception("Child process was terminated by signal " + toString(WTERMSIG(status)), ErrorCodes::CHILD_WAS_NOT_EXITED_NORMALLY);
    if (WIFSTOPPED(status))
        throw Exception("Child process was stopped by signal " + toString(WSTOPSIG(status)), ErrorCodes::CHILD_WAS_NOT_EXITED_NORMALLY);
    throw Exception("Child process was not exited normally by unknown reason", ErrorCodes::CHILD_WAS_NOT_EXITED_NORMALLY);
}
void ShellCommand::wait()