Docs for setting environment level tick rate#35412
Docs for setting environment level tick rate#35412ohbadiah wants to merge 1 commit intoMaterializeInc:mainfrom
Conversation
|
Thanks for opening this PR! Here are a few tips to help make the review process smooth for everyone. PR title guidelines
Pre-merge checklist
|
| `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] |
There was a problem hiding this comment.
725ba59 to
a6d3445
Compare
kay-kim
left a comment
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
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/).
doc/user/content/concepts/sources.md
Outdated
|
|
||
| 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 |
There was a problem hiding this comment.
Heh ... so, we don't mention TIMESTAMP INTERVAL in either CREATE SOURCE and ALTER SOURCE ... Could we add as well?
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
Should we mention its effect on the external system?
There was a problem hiding this comment.
Added a note:
Changing the timestamp interval does not significantly affect load on the
upstream system.
doc/user/content/concepts/sources.md
Outdated
| 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 |
There was a problem hiding this comment.
You can only use ALTER SYSTEM SET on self-managed right? For Materialize Cloud, we should direct customers to contact us
There was a problem hiding this comment.
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'); |
There was a problem hiding this comment.
Same comment as above regarding cloud vs. self-managed
There was a problem hiding this comment.
This one is alter source, not alter system set, right?
a6d3445 to
802403d
Compare
802403d to
a8e9200
Compare
kay-kim
left a comment
There was a problem hiding this comment.
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] |
There was a problem hiding this comment.
If you add an anchor here, you can link from the source page
| `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` |
There was a problem hiding this comment.
If you add the anchor (see below in the parameter table), you can go
[`default_timestamp_interval`](/sql/set/#default_timestamp_interval)
There was a problem hiding this comment.
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 ( |
There was a problem hiding this comment.
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>] | ||
| )] |
There was a problem hiding this comment.
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>] | ||
| )] |
There was a problem hiding this comment.
ditto w.r.t. the question about the new create source syntax for sql server.

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.