timescale / docs

Timescale product documentation 📖
https://docs.timescale.com/
52 stars 99 forks source link

[Docs RFC] Add best practice about indexes. #3232

Open billy-the-fish opened 5 months ago

billy-the-fish commented 5 months ago

In https://docs.timescale.com/use-timescale/latest/hypertables/hypertables-and-unique-indexes/#determine-the-partitioning-columns, update to say something like:

Before you create a unique index, you need to determine which unique indexes are allowed on your hypertable. Best practice is to create an index on the timestamp and other columns. For example, (user, timestamp) or (user, project, timestamp). You would use something like (user) or (user, project) as your segment key and partition on timestamp only.

Remove the second bullet point: _Any space-partitioning columns. Space partitions are optional and not included in every hypertable. You have a space-partitioning column if you specified the partitioningcolumn parameter when you creates your hypertable.

emizero commented 5 months ago

Add a note or warning that currently, you must create a unique index on a hypertable before enabling compression. Creating one after enabling compression will result in the following errror: ERROR: operation not supported on hypertables that have compression enabled

This limitation may also need to be reflected on the following page: https://docs.timescale.com/use-timescale/latest/limitations/