explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Fbih

Settings
# exclusive inclusive rows x rows loops node
1. 1,112.411 6,396.378 ↓ 1,094.8 106,192 1

Hash Join (cost=5,258.76..88,363.29 rows=97 width=624) (actual time=5,010.05..6,396.378 rows=106,192 loops=1)

  • Buffers: shared hit=1211467 read=143647 dirtied=37, temp read=139973 written=139973
2. 14.005 311.561 ↑ 1.1 108,287 1

Nested Loop (cost=0.71..82,674.69 rows=114,552 width=20) (actual time=1.714..311.561 rows=108,287 loops=1)

  • Buffers: shared hit=66784 read=1051 dirtied=3
3. 15.238 15.238 ↓ 1.0 446 1

Index Scan using "BookkeepingExport_pkey" on BookkeepingExport be (cost=0.28..373.76 rows=438 width=20) (actual time=1.362..15.238 rows=446 loops=1)

  • Filter: (be.month = (date_trunc('month'::text, now()) - '6 mons'::interval))
  • Buffers: shared hit=6197 read=153
4. 282.318 282.318 ↑ 1.3 243 446

Index Scan using "Bookkeeping_eebf80ab" on Bookkeeping b (cost=0.43..184.62 rows=328 width=32) (actual time=0.257..0.633 rows=243 loops=446)

  • Index Cond: (b.export_id = be.id)
  • Buffers: shared hit=60587 read=898 dirtied=3
5. 1,347.382 4,972.406 ↓ 749.2 1,255,580 1

Hash (cost=5,237.1..5,237.1 rows=1,676 width=628) (actual time=4,972.406..4,972.406 rows=1,255,580 loops=1)

  • Buffers: shared hit=1144683 read=142596 dirtied=34, temp written=97951
6. 192.072 3,625.024 ↓ 749.2 1,255,580 1

Nested Loop (cost=0.86..5,237.1 rows=1,676 width=628) (actual time=1.444..3,625.024 rows=1,255,580 loops=1)

  • Buffers: shared hit=1144683 read=142596 dirtied=34
7. 1.561 37.357 ↓ 365.0 365 1

Nested Loop (cost=0.43..4,932.77 rows=1 width=20) (actual time=1.091..37.357 rows=365 loops=1)

  • Buffers: shared hit=4564 read=1668
8. 15.706 15.706 ↓ 1.0 1,435 1

Seq Scan on Event e (cost=0..1,181.96 rows=1,429 width=20) (actual time=0.03..15.706 rows=1,435 loops=1)

  • Filter: (e.relevant_frame_start_time = (date_trunc('month'::text, now()) - '6 mons'::interval))
  • Buffers: shared hit=473
9. 20.090 20.090 ↓ 0.0 0 1,435

Index Scan using "Issue_pkey" on Issue i (cost=0.43..2.62 rows=1 width=32) (actual time=0.014..0.014 rows=0 loops=1,435)

  • Index Cond: (i.id = e.issue_ptr_id)
  • Filter: (((i.issue_type)::text = 'month_end_closing'::text) AND (date_trunc('month'::text, i.created_at) >= (now() - '1 year'::interval)))
  • Buffers: shared hit=4091 read=1668
10. 3,395.595 3,395.595 ↓ 2.5 3,440 365

Index Scan using "Record_2f4e4ac4" on Record r (cost=0.43..290.46 rows=1,387 width=624) (actual time=0.072..9.303 rows=3,440 loops=365)

  • Index Cond: (r.business_id = i.business_id)
  • Filter: (date_trunc('month'::text, r.created_at) >= (now() - '1 year'::interval))
  • Buffers: shared hit=1140119 read=140928 dirtied=34
Planning time : 1.698 ms
Execution time : 6,400.975 ms