Historian using TimescaleDB w/ Postgres

Looking for anyone who is using TimescaleDB with Postgres. I have it installed (and verified the extension is active in Postgres) but I don’t see any hypertables created so I’m questioning whether it was installed/configured correctly. Also, the DB seems to be growing more rapidly than what it did on FactoryTalk Historian with OSI PI. Since importing all 1750 tags yesterday afternoon at a polling rate of 1 second (with a max age of 5 seconds), the table is already 350MB. For comparison, the OSI PI archive file would be 1GB after 14 days of identical polling, so it seems I’m not getting compression.

1 Like

This is a guide I put together for our company on how to set all this up properly. I have default in this set to compressing data after 1 week, but you can change it how you see fit.

6 Likes

Thanks Michael.

When we enabled compression, it created a new table called sqlth_3_data leaving the sqlth_1_data table there, but now all the historical data is being written to the 3 table and in the sqlth_te table, each tag is duplicated now with a new ID. This isn’t right, is it?

Tags are expected to end up with multiple entries in sqlt_te as configurations change. Totally normal.

1 Like

Usually when that happens, doesn’t the previous version get a timestamp in the “retired” column?

It should, for the same driver ID. Did that change too? (Usually associated with a historian name change or gateway name change.)

Hi @michael.flagler thanks for sharing this, was just comparing it to our setup and noticed this section:

image
where is this set? is it in this section:

No, on your database connections there's a setting under the main configuration (not advanced) that is called Extra Connection Properties.

1 Like