Open ggevay opened 2 months ago
There is also a second bug here, which is that MIR EXPLAIN shows that a new arrangement is created, contradicting the physical plan:
I think this is a by-product of ArrangeBy
in MIR meaning "ensure that the output is arranged". We recently discussed in person that it might be better to hide ArrangeBy
operators if the underlying Get
has an AccessStrategy::Index
or AccessStrategy::SameDataflow
and the ArrangeBy
only requests arrangements on keys already provided by the input. I guess this will solve the issue here.
The arrangements of
i1
andi2
are the same arrangement, which is not good, because there is a differentRETAIN HISTORY
setting on them.
Even if we fix the original issue one open question that remains is what to do in the presence of ALTER INDEX RETAIN HISTORY
:
materialize=>
create table t(x int);
create index i1 on t(x) WITH (RETAIN HISTORY = FOR '10 sec');
create view v1 as
select * from t;
create index i2 on v1(x) WITH (RETAIN HISTORY = FOR '5 sec'); -- can use i1 as an input
alter index i1 SET (RETAIN HISTORY = FOR '1 sec'); -- effectively this will always be 5 seconds because of i2
Update: After reading through some more discussion items it seems that changing the retention window of a dependency for an index dataflow should not affect the retention index exported by that dataflow. See #27019.
What version of Materialize are you using?
593adeec056c2c423d07ff346042cb51dc750daf
What is the issue?
The arrangements of
i1
andi2
are the same arrangement, which is not good, because there is a differentRETAIN HISTORY
setting on them.There is also a second bug here, which is that MIR EXPLAIN shows that a new arrangement is created, contradicting the physical plan:
There is an ugly workaround where we add a dummy filter in the view:
cc @SangJunBak, @chaas, @lfest