Skip to content

UNION ALL optimization with constant false condition #8113

@EPluribusUnum

Description

@EPluribusUnum

Hi *!

CREATE OR ALTER VIEW union_opt
AS
SELECT 'A' union_id
FROM rdb$database
UNION ALL
SELECT 'B'
FROM rdb$database

SELECT *
FROM union_opt
WHERE union_id = 'A'

The select does 2 non-index reads.
I think it should be only 1 non-index read, as the second select expressions conditon is fix false, no row-by-row evaluation is needed.

Thank you!

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions