explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qUDW

Settings
# exclusive inclusive rows x rows loops node
1. 4.206 77.504 ↑ 904.6 5 1

Gather Motion 4:1 (slice6; segments: 4) (cost=0.00..205,223.44 rows=4,523 width=24) (actual time=77.499..77.504 rows=5 loops=1)

  • (slice0) Executor memory: 608K bytes.
  • (slice1) Executor memory: 94K bytes avg x 4 workers, 94K bytes max (seg0).
  • (slice2) Executor memory: 590K bytes avg x 4 workers, 590K bytes max (seg0). Work_mem: 2K bytes max.
  • (slice3) Executor memory: 158K bytes avg x 4 workers, 158K bytes max (seg0). Work_mem: 65K bytes max.
  • (slice4) Executor memory: 130K bytes avg x 4 workers, 130K bytes max (seg0). Work_mem: 65K bytes max.
  • (slice5) Executor memory: 226K bytes avg x 4 workers, 274K bytes max (seg3). Work_mem: 65K bytes max.
  • (slice6) Executor memory: 175K bytes avg x 4 workers, 178K bytes max (seg1).
  • (slice7)
2. 0.068 73.298 ↑ 565.5 2 1

GroupAggregate (cost=0.00..205,223.08 rows=1,131 width=24) (actual time=73.250..73.298 rows=2 loops=1)

  • Group Key: shk_event_log_1.office_id
3. 0.006 73.230 ↑ 565.5 2 1

Result (cost=0.00..205,223.04 rows=1,131 width=24) (actual time=73.187..73.230 rows=2 loops=1)

4. 0.246 73.224 ↑ 565.5 2 1

HashAggregate (cost=0.00..205,223.01 rows=1,131 width=32) (actual time=73.183..73.224 rows=2 loops=1)

  • Group Key: shk_event_log_1.office_id
  • Extra Text: (seg1) Hash chain length 1.0 avg, 1 max, using 2 of 32 buckets; total 0 expansions.
5. 0.000 72.978 ↑ 565.5 2 1

Redistribute Motion 4:4 (slice5; segments: 4) (cost=0.00..205,222.85 rows=1,131 width=32) (actual time=72.976..72.978 rows=2 loops=1)

  • Hash Key: shk_event_log_1.office_id
6. 0.002 73.497 ↑ 226.2 5 1

Result (cost=0.00..205,222.74 rows=1,131 width=32) (actual time=73.467..73.497 rows=5 loops=1)

7. 0.170 73.495 ↑ 226.2 5 1

HashAggregate (cost=0.00..205,222.74 rows=1,131 width=32) (actual time=73.467..73.495 rows=5 loops=1)

  • Group Key: shk_event_log_1.office_id
  • Extra Text: (seg3) Hash chain length 1.0 avg, 1 max, using 5 of 32 buckets; total 0 expansions.
8. 0.012 73.325 ↑ 56,736,398.7 12 1

Result (cost=0.00..114,971.00 rows=680,836,784 width=32) (actual time=73.275..73.325 rows=12 loops=1)

  • Filter: (((lag(shk_event_log_1.action_id) OVER (?)) IS NULL) OR ((CASE WHEN (shk_event_log_1.action_id = 110) THEN 1 ELSE 0 END) = 1) OR ((CASE WHEN (shk_event_log_1.action_id = ANY ('{120,125,130,140,199}'::integer[])) THEN 1 ELSE 0 END) = 1))
9. 0.017 73.313 ↑ 24,507,060.9 35 1

Result (cost=0.00..30,311.36 rows=857,747,130 width=32) (actual time=73.271..73.313 rows=35 loops=1)

10. 0.060 73.296 ↑ 73.0 35 1

WindowAgg (cost=0.00..2,863.45 rows=2,555 width=28) (actual time=73.264..73.296 rows=35 loops=1)

  • Partition By: shk_event_log_1.rid
  • Order By: shk_event_log_1.ts
11. 0.329 73.236 ↑ 73.0 35 1

Sort (cost=0.00..2,863.38 rows=2,555 width=28) (actual time=73.231..73.236 rows=35 loops=1)

  • Sort Key: shk_event_log_1.rid, shk_event_log_1.ts
  • Sort Method: quicksort Memory: 132kB
12. 0.000 72.907 ↑ 73.0 35 1

Redistribute Motion 4:4 (slice4; segments: 4) (cost=0.00..2,858.79 rows=2,555 width=28) (actual time=72.820..72.907 rows=35 loops=1)

  • Hash Key: shk_event_log_1.rid
13. 0.012 72.927 ↑ 127.8 20 1

Result (cost=0.00..2,858.57 rows=2,555 width=28) (actual time=72.869..72.927 rows=20 loops=1)

14. 0.101 72.915 ↑ 127.8 20 1

WindowAgg (cost=0.00..2,858.57 rows=2,555 width=28) (actual time=72.863..72.915 rows=20 loops=1)

  • Partition By: shk_event_log_1.office_id, shk_event_log_1.rid
  • Order By: shk_event_log_1.ts
15. 0.917 72.814 ↑ 127.8 20 1

Sort (cost=0.00..2,858.51 rows=2,555 width=24) (actual time=72.805..72.814 rows=20 loops=1)

  • Sort Key: shk_event_log_1.office_id, shk_event_log_1.rid, shk_event_log_1.ts
  • Sort Method: quicksort Memory: 132kB
16. 0.437 71.897 ↑ 127.8 20 1

Redistribute Motion 4:4 (slice3; segments: 4) (cost=0.00..2,854.57 rows=2,555 width=24) (actual time=71.889..71.897 rows=20 loops=1)

  • Hash Key: shk_event_log_1.office_id, shk_event_log_1.rid
17. 0.040 71.460 ↑ 73.0 35 1

Nested Loop (cost=0.00..2,854.38 rows=2,555 width=24) (actual time=40.463..71.460 rows=35 loops=1)

  • Join Filter: true
18. 0.016 40.202 ↑ 1.0 2 1

GroupAggregate (cost=0.00..437.72 rows=2 width=8) (actual time=40.200..40.202 rows=2 loops=1)

  • Group Key: shk_event_log.rid
19. 0.958 40.186 ↑ 1.0 2 1

Sort (cost=0.00..437.72 rows=2 width=8) (actual time=40.185..40.186 rows=2 loops=1)

  • Sort Key: shk_event_log.rid
  • Sort Method: quicksort Memory: 132kB
20. 5.498 39.228 ↑ 1.0 2 1

Redistribute Motion 4:4 (slice2; segments: 4) (cost=0.00..437.72 rows=2 width=8) (actual time=32.697..39.228 rows=2 loops=1)

  • Hash Key: shk_event_log.rid
21. 2.527 33.730 ↑ 1.0 2 1

Hash Semi Join (cost=0.00..437.72 rows=2 width=8) (actual time=33.611..33.730 rows=2 loops=1)

  • Hash Cond: (shk_event_log.office_id = branch_office.office_id)
  • Extra Text: (seg0) Hash chain length 1.0 avg, 1 max, using 79 of 65536 buckets.
22. 0.000 0.010 ↑ 1.0 2 1

Redistribute Motion 4:4 (slice1; segments: 4) (cost=0.00..6.00 rows=2 width=12) (actual time=0.010..0.010 rows=2 loops=1)

  • Hash Key: shk_event_log.office_id
23. 13.721 13.721 ↑ 1.0 2 1

Index Scan using core_wh_shk_event_log_shk_tracker_id_idx on shk_event_log (cost=0.00..6.00 rows=2 width=12) (actual time=0.320..13.721 rows=2 loops=1)

  • Index Cond: ((shk_tracker_id >= 1) AND (shk_tracker_id <= 2))
24. 0.026 31.193 ↓ 1.2 79 1

Hash (cost=431.71..431.71 rows=67 width=4) (actual time=31.193..31.193 rows=79 loops=1)

25. 31.167 31.167 ↓ 1.2 79 1

Seq Scan on branch_office (cost=0.00..431.71 rows=67 width=4) (actual time=0.070..31.167 rows=79 loops=1)

  • Filter: (NOT is_poo)
26. 31.218 31.218 ↑ 23.6 18 2

Index Scan using core_wh_shk_event_log_rid_idx on shk_event_log shk_event_log_1 (cost=0.00..37.68 rows=425 width=24) (actual time=0.124..15.609 rows=18 loops=2)

  • Index Cond: (rid = shk_event_log.rid)
Planning time : 237.327 ms
Execution time : 169.710 ms