.. include:: /Includes.rst.txt .. _task-1791151779: ====================================================== Task: Read the attendance of a team with fewer queries ====================================================== Description =========== The attendance view read the time zone, the settings, the weekly off rules and the holiday rules of the company again for every person it showed, and their absences, plans and employment one person at a time: about 31 queries a person. The working-day calendar now reads what a company shares once for all people of a view, and the absences, planned shifts and employment dates of all of them together; the time zone, the access settings and the company of an employee come from the entity manager, which answers a repeated question within a request without a query. A person now costs about 13 queries. Impact ====== ``PresenceDays::of()`` of ``adsum-leave`` takes the employee IDs of a view and returns their days by ID. ``WorkingDayCalendar::ranges()``, ``HolidayCalendar::forEmployees()``, ``PlannedShiftProvider::forRanges()`` and ``EmploymentFacts::employedRanges()`` read several employees of one company. The port ``AbsenceQuery`` of ``adsum-working-time`` gains ``absencesOfEmployees()``; an implementation outside adsum has to add it. .. index:: Database, package:adsum-leave, package:adsum-working-time, package:adsum-core