News for hackers. Stuff that matters.
Re:TimescaleDB vs. InfluxDB: built differently for time-seri... by neslinesli93 on Wednesday August 15, 2018 @02:04PM (#17768269)
Hi, thanks for the tips!

As I mentioned inside the article, I tested last year version of TimescaleDB (July/August 2017) and that was my experience with it out of the box.

I am really impressed by all the progress you've made, and hopefully I'll consider TimescaleDB as my first choice on the next iteration of the product I'm working on.

Now, I'm skimming through the docs[1] and as I understand, create_hypertable is called before all the data is migrated, thus all TimescaleDB indexes are already present during the migration. What is the way to create indexes after data migration?

[1] https://docs.timescale.com/v0.11/getting-started/migrating-d...

Re:TimescaleDB vs. InfluxDB: built differently for time-seri... by mfreed on Wednesday August 15, 2018 @02:14PM (#17768349)
Hi @neslinesli93, it's quite easy:

(1) Call create_hypertable with default indexes off (include an argument of `create_default_indexes => FALSE`) [1]

(2) Then just use a standard CREATE INDEX command on the hypertable at any time. B-Tree, hash index, GIN/Gist, single key, composite keys, etc. This DDL command will propagate to any existing chunks (and create them) and will be remembered to so any future chunks that are automatically created will also have these indexes [2]

[1] https://docs.timescale.com/latest/api#create_hypertable

[2] https://docs.timescale.com/latest/using-timescaledb/schema-m...

Re:TimescaleDB vs. InfluxDB: built differently for time-seri... by RobAtticus on Wednesday August 15, 2018 @02:08PM (#17768301)
>What is the way to create indexes after data migration?

You can migrate the data and then do the normal PostgreSQL `CREATE INDEX` syntax to create the indexes on the hypertable. It's not an option to create_hypertable or anything, but that's how you would achieve it.