History Queries (example: historic task query) currently perform the same authorization checks for each task from the same process. Yet, all tasks from the same process definition will share the same authorizations (for a given user / group configuration)
select distinct set of process definition keys from the table, calculate READ_HISTORY auths for that set and join it to the history table.
This approach will scale independently from the size of the history table and, more or less independently from the size of the auth. table.