Completely re-written SQL. Now we first assign gid (group identificator) to every performance event and vintage unit. Doing so will dramatically reduce need to move all data (including values of all slicers) between different CTEs.