Hi @Jakub Floch ,
SLEEP_TASK is a nonspecific wait type in SQL Server which oocurs when a task sleeps while waiting for a generic event to occur. The SLEEP_TASK wait means that a thread is waiting on a resource or waiting for some events to occur, and could indicate backgroud task scheduling, a query plan exchange operator that isn't tracked by CXPACKET, or it could be a hashing operation that spills to tempdb.
HASH SPILLS mean there is not enough memory to execute the query, and data has to be spilled into temped in order to execute. This usually results in slower performance and space consumption in tempdb. You should determine if hash spills are occuring first. You can run SQL Profiler and enable Hash Warning Events.
For more information: https://learn.microsoft.com/en-us/sql/relational-databases/event-classes/hash-warning-event-class?view=sql-server-ver15