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

Update docs about indexing #3734

Merged
merged 5 commits into from
Jan 31, 2025
Merged
Show file tree
Hide file tree
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
7 changes: 4 additions & 3 deletions use-timescale/schema-management/about-indexing.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ Because looking up data can take a long time, especially if you have a lot of
data in your hypertable, you can use an index to speed up read operations from
non-compressed chunks (which use their [own columnar indexes][about-compression]).

You can create an index on any combination of columns, as long as you include
the `time` column, for time-series data. Which column you choose to create your
You can create an index on any combination of columns. To define an index as a `UNIQUE` or `PRIMARY KEY` index, it must include the partitioning column (this is usually the time column).

Which column you choose to create your
index on depends on what kind of data you have stored.
When you create a hypertable, set the datatype for the `time` column as
`timestamptz` and not `timestamp`.
Expand Down Expand Up @@ -97,7 +98,7 @@ different queries. Here are some examples:
SELECT * FROM devices WHERE store_id = x
```

This queries the portion of the list with a specific store_id. The index is
This queries the portion of the list with a specific `store_id`. The index is
effective for this query, but could be a bit bloated; an index on just
`store_id` would probably be more efficient.

Expand Down
3 changes: 1 addition & 2 deletions use-timescale/schema-management/indexing.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,7 @@ keywords: [hypertables, indexes]
# Indexing data

You can use an index on your database to speed up read operations. You can
create an index on any combination of columns, as long as you include the `time`
column, for time-series data. Timescale supports all table objects supported
create an index on any combination of columns. Timescale supports all table objects supported
within PostgreSQL, including data types, indexes, and triggers.
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The bit about unique indexes is already provided further down.


You can create an index using the `CREATE INDEX` command. For example, to create
Expand Down