Details
-
Task
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
Description
(Coming from Monty's observations of queries ServiceNow makes)
Consider a query:
select ... from t1 where ... having count(value)= 0;
|
select ... from t1 where ... having count(value)< 10;
|
The idea is, as soon as we get enough matching row(s), we know the query would produce an empty resultset. This means we can stop the execution.
Requirements
Implicit grouping is needed, or GROUP BY with "HAVING group_col=.." so there's only one group.
Execution
The aggregate function could have an attached "end detector". "end detection" will detect when the HAVING condition becomes false and signal to stop the execution.