cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.18k stars 3.81k forks source link

aost: allow materialized view refresh with follower reads #96391

Open dbist opened 1 year ago

dbist commented 1 year ago

Is your feature request related to a problem? Please describe.

refreshing materialized views and bypassing foreground traffic has immediate benefit.

Describe the solution you'd like

I'd like to use syntax similar to the following

refresh materialized view materialized_query as of system time '-10s';

Describe alternatives you've considered

n/a

Additional context

today, the error returned is

invalid syntax: statement ignored: at or near "as": syntax error
SQLSTATE: 42601
DETAIL: source SQL:
refresh materialized view materialized_query as of system time '-10s'

Jira issue: CRDB-24099

ajwerner commented 1 year ago

One question is whether you should be able to move the snapshot used for the materialized view back in time with this mechanism?