History is not build if number of days is more than 8

There is a following problem with History component. When I select the date range 6…13 December (1 week and one incomplete day), then history charts for all entities are rendered OK (even though it takes about 5 seconds), but when I select the wider range by just adding one day namely 5…13 December (1 week plus 2 days), history page is not rendered at all: the icon is in waiting state and page is empty:

I have tried another period: 1…8 December is OK, 1…9 December fails. Magic.

Recorder is MySQL. I have enabled slow queries log and detected no queries slower than 2 seconds.

I have found the root of the issue. MySQL was failing with the following message:

Dec 13 17:47:55 debian hass[12043]: 2020-12-13 17:47:55 ERROR (SyncWorker_27) [homeassistant.components.recorder.util] Error executing query: (_mysql_exceptions.InternalError) (3, 'Error writing file \'/tmp/MY5EChFl\' (Errcode: 28 "No space left on device")')
Dec 13 17:47:55 debian hass[12043]: [SQL: SELECT states.domain AS states_domain, states.entity_id AS states_entity_id, states.state AS states_state, states.attributes AS states_attributes, states.last_changed AS states_last_changed, states.last_updated AS states_last_updated
Dec 13 17:47:55 debian hass[12043]: FROM states
Dec 13 17:47:55 debian hass[12043]: WHERE (states.domain IN (%s, %s, %s, %s, %s) OR states.last_changed = states.last_updated) AND states.last_updated > %s AND states.domain NOT IN (%s, %s) AND states.last_updated < %s ORDER BY states.entity_id, states.last_updated]

but the error alas was not shown on UI.