explain.depesz.com

PostgreSQL's explain analyze made readable

Result: pcO3 : Optimization for: plan #YolR

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 53.428 72.237 ↓ 0.0 0 1

Delete on audit_evs_all aea (cost=352.24..14,994.25 rows=300 width=38) (actual time=72.237..72.237 rows=0 loops=1)

2. 0.356 18.809 ↑ 1.0 300 1

Nested Loop (cost=352.24..14,994.25 rows=300 width=38) (actual time=0.201..18.809 rows=300 loops=1)

3. 0.240 16.653 ↑ 1.0 300 1

Subquery Scan on aea2 (cost=351.80..13,957.75 rows=300 width=40) (actual time=0.164..16.653 rows=300 loops=1)

4. 0.086 16.413 ↑ 1.0 300 1

Limit (cost=351.80..13,954.75 rows=300 width=8) (actual time=0.158..16.413 rows=300 loops=1)

5. 1.427 16.327 ↑ 243.7 300 1

Merge Right Join (cost=351.80..3,315,754.10 rows=73,118 width=8) (actual time=0.157..16.327 rows=300 loops=1)

  • Merge Cond: (evs.ev_id = aea_1.ev_id)
  • Filter: ((((aea_1.ev_id IS NOT NULL) AND (evs.ev_id IS NULL)) OR (aea_1.ev_id IS NULL)) AND ((evs.when_created <= (now() - '14 days'::interval)) OR (evs.when_created IS NULL)))
  • Rows Removed by Filter: 8,742
6. 0.309 0.309 ↑ 3,959.4 148 1

Index Scan using index_676288 on evs (cost=0.42..54,095.37 rows=585,986 width=16) (actual time=0.012..0.309 rows=148 loops=1)

7. 14.591 14.591 ↑ 1,690.7 9,042 1

Index Scan using idx_audit_evs_all_ei on audit_evs_all aea_1 (cost=0.56..2,956,738.02 rows=15,287,379 width=16) (actual time=0.139..14.591 rows=9,042 loops=1)

  • Filter: (when_created <= (now() - '14 days'::interval))
8. 1.800 1.800 ↑ 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.006..0.006 rows=1 loops=300)

  • Index Cond: (audit_ev_id = aea2.audit_ev_id)
Planning time : 9.668 ms
Execution time : 72.357 ms
Trigger times:
Trigger Name:Total time:Calls:Average time:
audit_evs_all_arc_tr 50.833 ms 300 0.169 ms