pratimsingha
Programmer
Requirement:
Via kafka, data are moving from a DB2 table to a seperate database table.
Our requirement is to collect the total row count of the table in DB2 and total rowcount of table in the other database and match whether they are equal.
Expectation is that the rowcount should be same otherwise alert will be thrown.
So Spring Batch service will be designed to check everyday at some specified time, the rowcount of the tables of both the database and generate a report.
Problem:
1. select count(*) from Table in DB2 is a very expensive operation. Please consider that the total rowcount of the table will be around millions.
2. Its a leagacy database design and therefore, there is no Primary key available. But we do have unique and non unique Indexes.
Any suggestion on what can be an alternative for select count(*) from Table.
Via kafka, data are moving from a DB2 table to a seperate database table.
Our requirement is to collect the total row count of the table in DB2 and total rowcount of table in the other database and match whether they are equal.
Expectation is that the rowcount should be same otherwise alert will be thrown.
So Spring Batch service will be designed to check everyday at some specified time, the rowcount of the tables of both the database and generate a report.
Problem:
1. select count(*) from Table in DB2 is a very expensive operation. Please consider that the total rowcount of the table will be around millions.
2. Its a leagacy database design and therefore, there is no Primary key available. But we do have unique and non unique Indexes.
Any suggestion on what can be an alternative for select count(*) from Table.