Skip to content

Explain plan can be misleading #8607

@richardstartin

Description

@richardstartin

I have a query as follows:

select count(*) from githubEvents where dateTrunc('YEAR', event_time) = '2016-01-01 00:00:00.0'

It produces a nonzero result:

count(*)
323650488

However, when I try an explain plan:

explain plan for select count(*) from githubEvents where dateTrunc('YEAR', event_time) = '2016-01-01 00:00:00.0'

The query plan picks a segment at random which should have been pruned, and doesn't reflect the way the query is evaluated:

Operator Operator_Id Parent_Id
BROKER_REDUCE(limit:10) 0 -1
COMBINE_AGGREGATE 1 0
FAST_FILTERED_COUNT 2 1
FILTER_EMPTY 3 2

It would be helpful if the plan chose a segment which has data, or queried all segments and merged operators when the operator varies according to segment.

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions