Commit 47d8edc
committed
push down filter: consider already pushed filters
If optimizer runs several times it can try to push filters into
table provider several times. But, `supports_filters_pushdown`
may be context-dependent. For example, it may support any filter
like `column=value` but not the both at the same time.
Consider the following optimizer run:
1. Try to push `a = 1, b = 1`.
`supports_filters_pushdown` returns [Exact, Inexact]
Ok, will remember that `a=1` is pushed and make a filter node for `b=1`.
...
Another optimization iteration.
2. Try to push `b = 1`.
`supports_filters_pushdown` returns [Exact]. Of course, the
table provider can't remember all pushed filters. So, there is nothing
to left but to answer: "Exact".
Now, the optimizer thinks that conjunction `a = 1 AND b = 1` is supported
exactly, but it's not.
To prevent this problem, this patch adds already pushed filters to the
`supports_filters_pushdown` call.1 parent 4abed57 commit 47d8edc
2 files changed
Lines changed: 11 additions & 10 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
872 | 872 | | |
873 | 873 | | |
874 | 874 | | |
875 | | - | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
876 | 882 | | |
877 | 883 | | |
878 | 884 | | |
| |||
889 | 895 | | |
890 | 896 | | |
891 | 897 | | |
892 | | - | |
893 | | - | |
894 | | - | |
895 | | - | |
896 | | - | |
897 | | - | |
898 | | - | |
| 898 | + | |
| 899 | + | |
899 | 900 | | |
900 | 901 | | |
901 | 902 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
666 | 666 | | |
667 | 667 | | |
668 | 668 | | |
669 | | - | |
| 669 | + | |
670 | 670 | | |
671 | 671 | | |
672 | 672 | | |
| |||
0 commit comments