Archiving Data Table records
I would like to archive some Data Table records we have stored in ThingWorx (with a PostgreSQL Persistence Provider). I don't have much experience with setting up/optimizing PostgreSQL databases, so I am looking for some input. Note that we have both an application server and a separate database server which also has a PostgreSQL persistence provider set up. The records in this table are currently stored using that external persistence provider on the database server, not the application server.
Old records would not need to be regularly accessed and I want to offload them to clean things up a bit and reduce the amount of records in this particular Data Table. The way I see it there are 3 ways to do this:
- Add the records to a separate Data Table which also stores data using the external persistence provider
- Set up a separate database/table in PostgreSQL (not part of the ThingWorx data model), and create SQL queries using a JDBC connection to retrieve records as needed
- Add the records to a flat file stored on the server
With option 1, would it improve query time if they are still in the ThingWorx data model? I know in the ThingWorx PostgreSQL database model, all data table entries are stored in the data_table table. Thus, if I simply move records from one Data Table to another, I am not sure if that would truly help query performance.
With option 2, if I set up a separate database in the same PostgreSQL installation, would there be any processing draw away from the main ThingWorx Data Table transactions? Assume that these records would hardly ever (perhaps even never) be accessed – if there are a large number (10s of thousands) of records sitting there in a separate database and are not updated or even queried, will PostgreSQL require server resources to maintain them, or is it only when they are queried?
I assume option 3 should definitely free up processing power, but it would be more annoying in case we do want to access the records in a nice way (in a mashup, for instance). So if option 2 and option 3 have the same net result on performance (again, assuming I am hardly ever touching the records), I would want to go with option 2.
Any inputs appreciated! Thank you!

