I have 3 database tables, each contain 6 million rows and adding 3 million rows every year.
Following are the table information: Table 1: 20 fields with 50 characters average in each filed. Has 2 indexes both are on timestamp fields. Table 2: 5 fields, 2 byte array field and 1 xml field Table 3: 4 fields, 1 byte array field
Following is the usage: Insert 15 to 20 records per second in each table. A view is created by joining first 2 tables and the select is mostly based on the date field in the first table.
Right Now, insert one record each in all three table together takes about 100 milliseconds.
I'm planning to migrate from postgres 8.4 to 9.2. I would like to do some optimization for insert performance also.Also, I'm planning to create history tables and keep the old record into those tables. I have the following questions in this regard
- Will create history tables and move older data to those tables help in increasing the insert performance?
- If it helps, how often I need to move the old records into the history tables, daily? or weekly/monthly/yearly?
- If i keep only one month (220,000) data instead of one year data (3 million) will it help in improving insert performance?
Thanks in advance, Sudheer