There is a specific requirement to get the accurate no of rows from database for showing progress while processing the data. The application supports a lot of databases, So looking for a generic approach.
The current approach is using count(*)/count(INDEXED_COLUMN)
but that is taking enormous amount of time. The time taken for count is significant to the actual processing which seems inappropriate.
Apart from that I have also tried using info from system tables but that is not 100% accurate and for updating the stats it's again taking a lot of time.
I want to reduce the count query time. Also, I want the accurate count from the query.