*
Size: a a a
*
СК
M
M
VY
cv.slugs
лежит, уже массив?M
cv.slugs
лежит, уже массив?M
M
DS
RL
D
V
explain SELECT DISTINCT on (t.uuid)
t.uuid as task_uuid,
ct. "name" city,
c.plate_number,
c.id car_id,
pa.created_at start_time,
(now() - pa.created_at) active_time,
--r.long_service_alert_interval allowed_time,
u.phone user_phone,
r.caption AS ROLE,
CONCAT_WS(' '::text, u.first_name, u.patronymic_name, u.last_name) AS user_name
FROM
performed_actions pa
JOIN tasks t ON t.uuid = pa.task_uuid
JOIN cars c ON t.car_id = c.id
JOIN cities ct ON ct.external_id = c.region_id
JOIN roles r ON r.uuid = t.role_uuid -- AND r.long_service_alert_interval IS NOT NULL
JOIN users u ON u.uuid = t.user_uuid
WHERE
t.finished_at IS NULL
AND(now() - pa.created_at) >= interval '20 minutes' --r.long_service_alert_interval
ORDER BY
t.uuid,
active_time DESC;
Unique (cost=698438.31..699336.05 rows=179549 width=517)
-> Sort (cost=698438.31..698887.18 rows=179549 width=517)
Sort Key: t.uuid, ((now() - pa.created_at)) DESC
-> Hash Join (cost=296229.54..682769.05 rows=179549 width=517)
Hash Cond: (t.user_uuid = u.uuid)
-> Hash Join (cost=295933.68..680654.89 rows=179549 width=473)
Hash Cond: (t.role_uuid = r.uuid)
-> Hash Join (cost=295931.96..680119.43 rows=179549 width=215)
Hash Cond: (t.car_id = c.id)
-> Hash Join (cost=220800.77..602514.80 rows=180787 width=60)
Hash Cond: (pa.task_uuid = t.uuid)
-> Seq Scan on performed_actions pa (cost=0.00..376286.51 rows=2067629 width=24)
Filter: ((now() - created_at) >= '00:20:00'::interval)
-> Hash (cost=215722.12..215722.12 rows=406292 width=52)
-> Bitmap Heap Scan on tasks t (cost=12957.20..215722.12 rows=406292 width=52)
Recheck Cond: (finished_at IS NULL)
-> Bitmap Index Scan on ix__tasks__finished_at (cost=0.00..12855.62 rows=406292 width=0)
Index Cond: (finished_at IS NULL)
-> Hash (cost=74920.86..74920.86 rows=16827 width=159)
-> Hash Join (cost=1.68..74920.86 rows=16827 width=159)
Hash Cond: (c.region_id = ct.external_id)
-> Index Scan using cars_pkey on cars c (cost=0.41..74687.78 rows=16943 width=17)
-> Hash (cost=1.12..1.12 rows=12 width=150)
-> Seq Scan on cities ct (cost=0.00..1.12 rows=12 width=150)
-> Hash (cost=1.32..1.32 rows=32 width=290)
-> Seq Scan on roles r (cost=0.00..1.32 rows=32 width=290)
-> Hash (cost=228.16..228.16 rows=5416 width=71)
-> Seq Scan on users u (cost=0.00..228.16 rows=5416 width=71)
DS
could not resize shared memory segment "/PostgreSQL.1284959199" to 2147483648 bytes: No space left on device
CONTEXT: parallel worker
V
could not resize shared memory segment "/PostgreSQL.1284959199" to 2147483648 bytes: No space left on device
CONTEXT: parallel worker
DS
V
DS
V
I
V