bugs.gh_7863_test. Non-correlated sub-query is evaluated multiple times if it is based on a VIEW rathe than on appropriate derived table.