I am downloading data from salesforce API. The table is big and I am using query_more to get full result. The problem is totalSize returned in result does not always match to the actual number of records returned. It can be few records less, sometimes it matches exactly.
Is totalSize an estimation only or it should match exactly with the number of records returned? Please help to clarify this issue. Code of method returning query result:
sf_conn = self.get_conn()
result = sf_conn.query(self.soql)
totalSize = result['totalSize'] # This does not always match !!!
logging.info('Total result set size: %s', totalSize )
while True:
yield result
if result['done']:
break
result = sf_conn.query_more(result['nextRecordsUrl'], identifier_is_url=True)