Skip to content

Docs for setting environment level tick rate#35412

Open
ohbadiah wants to merge 1 commit intoMaterializeInc:mainfrom
ohbadiah:nickmcavoy/clu-32-document-environment-level-tick-rate
Open

Docs for setting environment level tick rate#35412
ohbadiah wants to merge 1 commit intoMaterializeInc:mainfrom
ohbadiah:nickmcavoy/clu-32-document-environment-level-tick-rate

Conversation

@ohbadiah
Copy link
Contributor

In #35027 and #35046 we made it possible to set a default tick rate at the environment level. It's not really documented yet. This is an effort to supply the missing documentation.

@ohbadiah ohbadiah requested a review from a team as a code owner March 11, 2026 01:49
@github-actions
Copy link

Thanks for opening this PR! Here are a few tips to help make the review process smooth for everyone.

PR title guidelines

  • Use imperative mood: "Fix X" not "Fixed X" or "Fixes X"
  • Be specific: "Fix panic in catalog sync when controller restarts" not "Fix bug" or "Update catalog code"
  • Prefix with area if helpful: compute: , storage: , adapter: , sql:

Pre-merge checklist

  • The PR title is descriptive and will make sense in the git log.
  • This PR has adequate test coverage / QA involvement has been duly considered. (trigger-ci for additional test/nightly runs)
  • If this PR includes major user-facing behavior changes, I have pinged the relevant PM to schedule a changelog post.
  • This PR has an associated up-to-date design doc, is a design doc (template), or is sufficiently small to not require a design.
  • If this PR evolves an existing $T ⇔ Proto$T mapping (possibly in a backwards-incompatible way), then it is tagged with a T-proto label.
  • If this PR will require changes to cloud orchestration or tests, there is a companion cloud PR to account for those changes that is tagged with the release-blocker label (example).

@ohbadiah ohbadiah marked this pull request as draft March 11, 2026 01:49
`client_encoding` | `UTF8` | The client's character set encoding. The only supported value is `UTF-8`. | Yes
`client_min_messages` | `notice` | The message levels that are sent to the client. <br/><br/> Accepts values: `debug5`, `debug4`, `debug3`, `debug2`, `debug1`, `log`, `notice`, `warning`, `error`. Each level includes all the levels that follow it. | Yes
`datestyle` | `ISO, MDY` | The display format for date and time values. The only supported value is `ISO, MDY`. | Yes
`default_timestamp_interval` | `1s` | The default timestamping interval for sources and tables. Only applies as a default for newly-created sources — existing sources are not affected when this value changes. Sources created with an explicit `TIMESTAMP INTERVAL` option use that value instead. To change the interval on an existing source, use [`ALTER SOURCE ... SET`](/sql/alter-source/). | [Contact support]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Image

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ohbadiah ohbadiah force-pushed the nickmcavoy/clu-32-document-environment-level-tick-rate branch 2 times, most recently from 725ba59 to a6d3445 Compare March 11, 2026 02:28
@ohbadiah ohbadiah marked this pull request as ready for review March 11, 2026 02:29
Copy link
Contributor

@kay-kim kay-kim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this! Left some comments

`client_encoding` | `UTF8` | The client's character set encoding. The only supported value is `UTF-8`. | Yes
`client_min_messages` | `notice` | The message levels that are sent to the client. <br/><br/> Accepts values: `debug5`, `debug4`, `debug3`, `debug2`, `debug1`, `log`, `notice`, `warning`, `error`. Each level includes all the levels that follow it. | Yes
`datestyle` | `ISO, MDY` | The display format for date and time values. The only supported value is `ISO, MDY`. | Yes
`default_timestamp_interval` | `1s` | The default timestamping interval for sources and tables. Only applies as a default for newly-created sources — existing sources are not affected when this value changes. Sources created with an explicit `TIMESTAMP INTERVAL` option use that value instead. To change the interval on an existing source, use [`ALTER SOURCE ... SET`](/sql/alter-source/). | [Contact support]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if we can combine the 3 sentences like (spitballing -- and I might be making stuff up about the subsources/tables😄 ):

The timestamp interval set during source creation and used for the source and its subsources/tables if `TIMESTAMP INTERVAL` is not specified in the `CREATE SOURCE` statement. Changes to this value affect only newly created sources; existing sources continue using the interval set at creation time. To change the interval for an existing source, use [`ALTER SOURCE ... SET`](/sql/alter-source/).


You can set an environment-wide default timestamp interval, and override it
on individual sources. See [`ALTER SYSTEM SET`](/sql/alter-system-set/) for
the environment default, and [`CREATE SOURCE`](/sql/create-source/) and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Heh ... so, we don't mention TIMESTAMP INTERVAL in either CREATE SOURCE and ALTER SOURCE ... Could we add as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Petros had already documented ALTER SOURCE. Good catch on CREATE SOURCE! I added to the examples for each source.

## Timestamp interval

The timestamp interval controls how frequently Materialize timestamps new data
from a source. A shorter interval means fresher data but consumes more
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we mention its effect on the external system?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a note:

Changing the timestamp interval does not significantly affect load on the
upstream system.

resources; a longer interval reduces load at the cost of data freshness.

You can set an environment-wide default timestamp interval, and override it
on individual sources. See [`ALTER SYSTEM SET`](/sql/alter-system-set/) for
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can only use ALTER SYSTEM SET on self-managed right? For Materialize Cloud, we should direct customers to contact us

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed - the current version just gives the name of the param, without reference to how it is set.

### Setting the timestamp interval

```mzsql
ALTER SOURCE kafka_src SET (TIMESTAMP INTERVAL = '500ms');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same comment as above regarding cloud vs. self-managed

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one is alter source, not alter system set, right?

@ohbadiah ohbadiah force-pushed the nickmcavoy/clu-32-document-environment-level-tick-rate branch from a6d3445 to 802403d Compare March 13, 2026 15:53
@ohbadiah ohbadiah force-pushed the nickmcavoy/clu-32-document-environment-level-tick-rate branch from 802403d to a8e9200 Compare March 13, 2026 16:06
@ohbadiah ohbadiah requested review from kay-kim and maheshwarip March 13, 2026 16:10
Copy link
Contributor

@kay-kim kay-kim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this. Left some questions.

`client_encoding` | `UTF8` | The client's character set encoding. The only supported value is `UTF-8`. | Yes
`client_min_messages` | `notice` | The message levels that are sent to the client. <br/><br/> Accepts values: `debug5`, `debug4`, `debug3`, `debug2`, `debug1`, `log`, `notice`, `warning`, `error`. Each level includes all the levels that follow it. | Yes
`datestyle` | `ISO, MDY` | The display format for date and time values. The only supported value is `ISO, MDY`. | Yes
`default_timestamp_interval` | `1s` | How frequently newly-created sources [timestamp incoming data](/concepts/sources/#timestamp-interval), unless a per-source override is set. | [Contact support]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you add an anchor here, you can link from the source page

Suggested change
`default_timestamp_interval` | `1s` | How frequently newly-created sources [timestamp incoming data](/concepts/sources/#timestamp-interval), unless a per-source override is set. | [Contact support]
`default_timestamp_interval` | `1s` | <a name="default_timestamp_interval"></a>How frequently newly-created sources [timestamp incoming data](/concepts/sources/#timestamp-interval), unless a per-source override is set. | [Contact support]

Changing the timestamp interval does not significantly affect load on the
upstream system.

The environment default is controlled by the `default_timestamp_interval`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you add the anchor (see below in the parameter table), you can go

[`default_timestamp_interval`](/sql/set/#default_timestamp_interval)

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, we no longer mention that this value is set for a source at the time of its creation (and the system parameter doesn't affect afterwards). Is that on purpose?

]
[EXPOSE PROGRESS AS <progress_subsource_name>]
[WITH (RETAIN HISTORY FOR <retention_period>)]
[WITH (
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not ideal ... but could it be more (for now ):

[WITH (
    RETAIN HISTORY FOR <retention_period> | TIMESTAMP INTERVAL <interval>
    [,... ]
  )]

I don't want people to think if you use WITH that you need to include RETAIN HISTORY FOR if you're only setting timestamp interval.

[WITH (
RETAIN HISTORY FOR <retention_period>
[, TIMESTAMP INTERVAL <interval>]
)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So ... do we or do we not set this for the new postgres syntax?

https://preview.materialize.com/materialize/35412/sql/create-source/postgres-v2/#syntax ?

The associated create table from source has some with options ... but per description, it seems like one would set it at the source.

[WITH (
RETAIN HISTORY FOR <retention_period>
[, TIMESTAMP INTERVAL <interval>]
)]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ditto w.r.t. the question about the new create source syntax for sql server.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants