explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YdgV

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Delete on session_rpi (cost=9,543.73..13,843.17 rows=500 width=38) (actual rows= loops=)

2. 0.000 0.000 ↓ 0.0

Nested Loop (cost=9,543.73..13,843.17 rows=500 width=38) (actual rows= loops=)

3. 0.000 0.000 ↓ 0.0

HashAggregate (cost=9,543.17..9,548.17 rows=500 width=40) (actual rows= loops=)

  • Group Key: "ANY_subquery".id
4. 0.000 0.000 ↓ 0.0

Subquery Scan on ANY_subquery (cost=3.37..9,541.92 rows=500 width=40) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Limit (cost=3.37..9,536.92 rows=500 width=8) (actual rows= loops=)

6.          

Initplan (for Limit)

7. 0.000 0.000 ↓ 0.0

Seq Scan on app_property (cost=0.00..2.80 rows=1 width=1) (actual rows= loops=)

  • Filter: ((property_name)::text = 'rp.sc.common.enable_upload_operations_to_main_office'::text)
8. 0.000 0.000 ↓ 0.0

Index Scan using idx_session_rpi_created_at on session_rpi sr (cost=0.57..123,249,287.26 rows=6,463,977 width=8) (actual rows= loops=)

  • Index Cond: (created_at < (now() - '8 mons'::interval))
  • Filter: ((NOT $0) OR (NOT (SubPlan 2)))
9.          

SubPlan (for Index Scan)

10. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=0.85..158.99 rows=12 width=0) (actual rows= loops=)

  • Filter: ((o.register_main_office_id IS NULL) OR (register.response_date IS NULL))
11. 0.000 0.000 ↓ 0.0

Index Scan using idx_rpi_operation_rpi_id on rpi_operation o (cost=0.57..46.58 rows=14 width=8) (actual rows= loops=)

  • Index Cond: (sr.id = rpi_id)
12. 0.000 0.000 ↓ 0.0

Index Scan using register_operation_main_office_pkey on register_operation_main_office register (cost=0.29..8.02 rows=1 width=16) (actual rows= loops=)

  • Index Cond: (o.register_main_office_id = id)
13. 0.000 0.000 ↓ 0.0

Index Scan using session_rpi_pkey on session_rpi (cost=0.56..8.58 rows=1 width=14) (actual rows= loops=)

  • Index Cond: (id = "ANY_subquery".id)