explain.depesz.com

PostgreSQL's explain analyze made readable

Result: upIy : Optimization for: plan #YolR

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 5,332.450 5,804.093 ↓ 0.0 0 1

Delete on audit_evs_all aea (cost=0.44..3,134.49 rows=300 width=38) (actual time=5,804.093..5,804.093 rows=0 loops=1)

2. 0.850 471.643 ↑ 1.0 300 1

Nested Loop (cost=0.44..3,134.49 rows=300 width=38) (actual time=390.918..471.643 rows=300 loops=1)

3. 0.419 394.293 ↑ 1.0 300 1

Subquery Scan on aea2 (cost=0.00..2,097.99 rows=300 width=40) (actual time=390.844..394.293 rows=300 loops=1)

4. 0.164 393.874 ↑ 1.0 300 1

Limit (cost=0.00..2,094.99 rows=300 width=8) (actual time=390.838..393.874 rows=300 loops=1)

5. 224.165 393.710 ↑ 47,921.0 300 1

Seq Scan on audit_evs_all aea_1 (cost=0.00..100,393,934.76 rows=14,376,298 width=8) (actual time=390.837..393.710 rows=300 loops=1)

  • Filter: (((ev_id IS NULL) AND (when_created <= (now() - '14 days'::interval))) OR (NOT (alternatives: SubPlan 1 or hashed SubPlan 2)))
  • Rows Removed by Filter: 1,314
6.          

SubPlan (for Seq Scan)

7. 0.000 0.000 ↓ 0.0 0

Index Only Scan using index_676288 on evs (cost=0.42..3.44 rows=1 width=0) (never executed)

  • Index Cond: (ev_id = aea_1.ev_id)
  • Heap Fetches: 0
8. 169.545 169.545 ↑ 1.0 582,698 1

Seq Scan on evs evs_1 (cost=0.00..35,054.86 rows=585,986 width=8) (actual time=0.013..169.545 rows=582,698 loops=1)

9. 76.500 76.500 ↑ 1.0 1 300

Index Scan using audit_evs_all_pk on audit_evs_all aea (cost=0.44..3.46 rows=1 width=14) (actual time=0.255..0.255 rows=1 loops=300)

  • Index Cond: (audit_ev_id = aea2.audit_ev_id)
Planning time : 3.620 ms
Execution time : 5,804.211 ms
Trigger times:
Trigger Name:Total time:Calls:Average time:
audit_evs_all_arc_tr 5,327.330 ms 300 17.758 ms