In Drupal 7, if you use Views in combination with a search index from Search API, and you try to use the Global: Result summary in the header or footer of the View, you may find that the total number of results matches the number of items on the page, not the total number of items in the search index.
To correct this issue, hook_views_pre_execute will make everything work as you would expect.