Skip to content

Union all ItemsLimit pushdown #46935

Description

@Vladilen

In a query like:

PRAGMA kikimr.KqpPushOlapProcess="true";
PRAGMA kikimr.OptEnablePredicateExtract="true";
PRAGMA kikimr.OptEnableOlapPushdownProjections="true";
PRAGMA OptimizeSimpleILIKE;
PRAGMA AnsiLike;
SELECT a,b,c
FROM `table1`
WHERE (`timestamp`) >= DateTime('2026-07-16T11:30:00Z') AND (`timestamp`) < DateTime('2026-07-16T13:30:00Z')
AND (a >= 9) AND ( a <= 15)

UNION ALL

SELECT a,b,c
FROM `table2`
WHERE (`timestamp`) >= DateTime('2026-07-16T11:30:00Z') AND (`timestamp`) < DateTime('2026-07-16T13:30:00Z')
AND (a >= 9) AND ( a <= 15)

ORDER BY `timestamp` DESC

LIMIT 10;

Limit 10 is not pushdowned to ColumnShard and CS reads all data.

If I run each query separately, ItemsLimit is pushdowned and CS returns early

Metadata

Metadata

Assignees

Labels

Type

Fields

No fields configured for Bug.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions