Increase ID space from Integer to Long selectively for large tables

Description

INT is used for storing IDs in database. Limit of INT is 2,147,483,647 (around 2 Billion records). Our biggest tables FINANCIAL_TRXN will be the first table to get hit if we cross the limit of 2Billion records of financial transactions. It was found that in a 100 GB Mifos database the MAX(TRXN_ID)was 147,913,398. We are going to exhaust the ID space when DB space reaches in around 10-50 TB, assuming linear growth in ID space versus DB space (ID space is directly proportional to [N * DB space] where N is a constant > 1). It will be difficult to increase the ID space (changing INT to LONG) when DB crosses limit of a Tera Bytes (TB) as time of applying the upgrade will be huge.

Increasing ID space would mean a large database upgrade which would cause a long downtime for large databases.

Resolving of this issue,
1) Figure out which tables are large
2) Create database upgrade (one upgrade per alter statement)
3) Find out the upgrade time
3) Make related code change in Entities and hibernate mappings.

Environment

None

Assignee

mifosdeveloperqueue

Reporter

UdaiU

Labels

None

Implementation Priority

None

URL

None

Story Points

None

Team

Core

Scheduled For

Product

Epic

None

productboard URL

None

Man Day Estimate

None

Components

Fix versions

Affects versions

Priority

Trivial
Configure