Description
TOP 0 guarantees an empty result, and HAVING (1 = 0) independently rejects
the aggregate row. The scan and aggregation therefore cannot contribute to
the result.
Expected: the optimizer produces an empty-result plan without scanning or
aggregating rift_t.
Actual: the generated plan retains the scan and aggregate processing.
How to repeat
EXPLAIN ('SELECT TOP 0 COUNT(*) FROM rift_t');
EXPLAIN ('SELECT TOP 0 COUNT(*) FROM rift_t HAVING (1 = 0)');
Version
Virtuoso Open Source Server 07.20.3240; Virtuoso ODBC Driver 07.20.3243;
Windows x64 client; WSL2 Docker server.
Description
TOP 0guarantees an empty result, andHAVING (1 = 0)independently rejectsthe aggregate row. The scan and aggregation therefore cannot contribute to
the result.
Expected: the optimizer produces an empty-result plan without scanning or
aggregating
rift_t.Actual: the generated plan retains the scan and aggregate processing.
How to repeat
Version
Virtuoso Open Source Server 07.20.3240; Virtuoso ODBC Driver 07.20.3243;
Windows x64 client; WSL2 Docker server.