Might there be a way to take advantage of the difference between count(*) and count(field_identier) ?
eg. count(*) counts all rows, whereas count(field_intentier) counts only the fields that are not null.
My thinking is that if each row had something like an is_countable field that was null for rows not wanted to be counted it could simplify the query and hopefully improve performance. The cost being that the field would need to be updated which might offset any benefit it might provide.