Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix autocluster example #5601

Merged
merged 1 commit into from
May 21, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions advocacy_docs/pg_extensions/advanced_storage_pack/using.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ This example is for an IoT thermostat that reports house temperatures and temper
```sql
CREATE TABLE iot (
thermostat_id BIGINT NOT NULL,
recordtime TIMESTAMPTZ NOT NULL,
recordtime TIME NOT NULL,
measured_temperature FLOAT4,
temperature_setting FLOAT4
) USING autocluster;
Expand All @@ -180,12 +180,12 @@ The `cols` parameter specifies the table that's clustered. In this case, `{1}` c
Populate the table with the `thermostat_id` and `recordtime` data:

```sql
INSERT INTO iot (thermostat_id, recordtime) VALUES (456, 12:01);
INSERT INTO iot (thermostat_id, recordtime) VALUES (8945, 04:55);
INSERT INTO iot (thermostat_id, recordtime) VALUES (456, 15:32);
INSERT INTO iot (thermostat_id, recordtime) VALUES (6785, 01:36);
INSERT INTO iot (thermostat_id, recordtime) VALUES (456, 19:25);
INSERT INTO iot (thermostat_id, recordtime) VALUES (5678, 03:44);
INSERT INTO iot (thermostat_id, recordtime) VALUES (456, '12:01');
INSERT INTO iot (thermostat_id, recordtime) VALUES (8945, '04:55');
INSERT INTO iot (thermostat_id, recordtime) VALUES (456, '15:32');
INSERT INTO iot (thermostat_id, recordtime) VALUES (6785, '01:36');
INSERT INTO iot (thermostat_id, recordtime) VALUES (456, '19:25');
INSERT INTO iot (thermostat_id, recordtime) VALUES (5678, '03:44');
```

When you select the data from the IoT table, you can see from the ctid location that the data with the same `thermostat_id` was clustered together:
Expand Down