2 Replies Latest reply on Jun 16, 2017 4:52 AM by atripathi RSS
    atripathi Newbie

    Thingworx (PostgreSQL): Datatable table purge options



    We are using PostgreSQL as data-persistence provider for our Thingworx platform 7.3 (planning for TW 8.0 upgrade in near future). As our data is kind of relational so mainly using datatable table.


    Considering growing size of datatable table (over time), we are looking for possible advisable (and efficient) options to purge datatable table of Thingworx's PostgreSQL database.

    Say purge-strategy like, just keep last 1-month of data.

    Thanks in advance.



      • Re: Thingworx (PostgreSQL): Datatable table purge options
        supandey Collaborator

        Hi Atul, to begin with before you implement any purge strategy it would be important to have a valid backup and recovery strategy. I have seen quite a few cases where users decides to purse Datatable and ValueStream/Stream entries and they end up purging more than needed and then there's no Ctrl + Z. So to begin with it would be strongly recommended to have backup and restore strategy if one is not already in place.


        As to the purging if you are absolutely sure that the data in there and is not needed and you want to have some sort of automated purge keeping just a month's data you may want to look into implementing your own Scheduler Thing which will execute deletion of table entries based on the data and time or other constraint as you wish to add to that service. There's out of the box service available for deleting the data from the DataTable or the ValueStream/Streams

          • Re: Thingworx (PostgreSQL): Datatable table purge options
            atripathi Newbie

            Thanks for the quick response Sushant.


            So what would be better/efficient approach for purging table DataTable:-

            • Execute delete-sql script directly on database table (DataTable) OR
            • Use Thingworx API to do so


            As you had mentioned "There's out of the box service available for deleting the data from the DataTable or the ValueStream/Streams". Could you share some (and if any community/support/documentation link for the same)