citusdata / citusdata/citus

Suggestion for improving SelectedChunkMask (Columnar)

Open
#4,934 1 comment 0 reactions 0 assignees View on GitHub
columnar
Dominant language
C
Stars
12.8k
Forks
794
Avg merge
2d 14h
Merged PRs (30d)
31

Description

In columnar_reader.c in SelectedChunkMask() a call to predicate_refuted_by is made for each individual var. Because of this a where clause with an OR over multiple columns, like
```sql
WHERE a=1 OR b=1
```
will never filter out any chunks.
The solution is to put the min/max-predicates for all vars in a list and call predicate_refuted_by only once.
I implemented this for cstore_fdw (I have not been able to get the new citus extension running on my postgresql), see renevdzee/cstore_fdw@2c896d7 , and it seems to work and improves performance a lot.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.