explain.depesz.com

PostgreSQL's explain analyze made readable

Result: vCeF

Settings
# exclusive inclusive rows x rows loops node
1. 0.023 392,597.774 ↑ 1.0 50 1

Limit (cost=5,539,325.72..5,539,328.22 rows=50 width=561) (actual time=392,597.687..392,597.774 rows=50 loops=1)

2. 0.049 392,597.751 ↑ 4,749.5 50 1

Unique (cost=5,539,325.72..5,551,199.42 rows=237,474 width=561) (actual time=392,597.685..392,597.751 rows=50 loops=1)

3. 9,641.002 392,597.702 ↑ 4,749.5 50 1

Sort (cost=5,539,325.72..5,539,919.40 rows=237,474 width=561) (actual time=392,597.683..392,597.702 rows=50 loops=1)

  • Sort Key: attempt0_.creation_date DESC, attempt0_.id, attempt0_.log, attempt0_.action, attempt0_.action_condition, attempt0_.allowed, attempt0_.attempt_group_id, attempt0_.condition_met, attempt0_.event, attempt0_.external_system_ticket_id, attempt0_.incoming_value, attempt0_.initiation_ip, attempt0_.payment_id, attempt0_.relay_id, attempt0_.resource_id, attempt0_.rule_version_id, attempt0_.status, attempt0_.task_id, attempt0_.wm_assignment_id
  • Sort Method: external merge Disk: 540,168kB
4. 1,200.421 382,956.700 ↓ 10.7 2,537,247 1

Nested Loop (cost=24.30..5,397,988.37 rows=237,474 width=561) (actual time=0.564..382,956.700 rows=2,537,247 loops=1)

5. 0.038 0.038 ↑ 1.0 1 1

Index Only Scan using company_pkey on company company2_ (cost=0.14..8.16 rows=1 width=8) (actual time=0.035..0.038 rows=1 loops=1)

  • Index Cond: (id = 154)
  • Heap Fetches: 1
6. 15,605.974 381,756.241 ↓ 10.7 2,537,247 1

Hash Join (cost=24.15..5,395,605.46 rows=237,474 width=569) (actual time=0.526..381,756.241 rows=2,537,247 loops=1)

  • Hash Cond: (attempt0_.relay_id = relay1_.id)
7. 366,150.073 366,150.073 ↑ 1.0 63,664,968 1

Seq Scan on attempt attempt0_ (cost=0.00..5,153,060.78 rows=64,038,878 width=561) (actual time=0.046..366,150.073 rows=63,664,968 loops=1)

8. 0.006 0.194 ↓ 2.0 6 1

Hash (cost=24.11..24.11 rows=3 width=16) (actual time=0.194..0.194 rows=6 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
9. 0.188 0.188 ↓ 2.0 6 1

Seq Scan on relay relay1_ (cost=0.00..24.11 rows=3 width=16) (actual time=0.127..0.188 rows=6 loops=1)

  • Filter: (company_id = 154)
  • Rows Removed by Filter: 838