explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7lz

Settings
# exclusive inclusive rows x rows loops node
1. 0.088 22,557.512 ↑ 30.1 41 1

Sort (cost=592,849.56..592,852.65 rows=1,236 width=104) (actual time=22,557.508..22,557.512 rows=41 loops=1)

  • Sort Key: task.id
  • Sort Method: quicksort Memory: 30kB
  • Buffers: shared hit=50794 read=414278 dirtied=7
2. 8.754 22,557.424 ↑ 30.1 41 1

Hash Join (cost=408,475.41..592,786.08 rows=1,236 width=104) (actual time=21,477.451..22,557.424 rows=41 loops=1)

  • Hash Cond: (task.id = complaint.entity_id)
  • Buffers: shared hit=50794 read=414278 dirtied=7
3. 1,572.101 1,572.101 ↓ 1.0 45,613 1

Seq Scan on task (cost=0.00..184,127.33 rows=45,600 width=104) (actual time=13.392..1,572.101 rows=45,613 loops=1)

  • Filter: (date_created >= '2020-04-19 13:41:04.417786'::timestamp without time zone)
  • Rows Removed by Filter: 1633695
  • Buffers: shared read=163128
4. 0.015 20,976.569 ↑ 1,057.7 43 1

Hash (cost=407,906.89..407,906.89 rows=45,481 width=4) (actual time=20,976.569..20,976.569 rows=43 loops=1)

  • Buckets: 65536 Batches: 1 Memory Usage: 514kB
  • Buffers: shared hit=50794 read=251150 dirtied=7
5. 0.111 20,976.554 ↑ 1,057.7 43 1

HashAggregate (cost=407,452.08..407,906.89 rows=45,481 width=4) (actual time=20,976.482..20,976.554 rows=43 loops=1)

  • Group Key: complaint.entity_id
  • Buffers: shared hit=50794 read=251150 dirtied=7
6. 17.668 20,976.443 ↑ 1,117.6 69 1

Merge Anti Join (cost=401,150.86..407,259.30 rows=77,114 width=4) (actual time=20,952.698..20,976.443 rows=69 loops=1)

  • Merge Cond: (complaint.entity_id = activity.object_id)
  • Buffers: shared hit=50794 read=251150 dirtied=7
7. 83.912 83.912 ↑ 1.0 89,893 1

Index Only Scan using complaint_entity_type_entity_id_user_id_unique on complaint (cost=0.42..5,854.91 rows=89,944 width=4) (actual time=7.427..83.912 rows=89,893 loops=1)

  • Index Cond: (entity_type = 'task'::text)
  • Heap Fetches: 89893
  • Buffers: shared hit=50701 read=1597
8. 40.614 20,874.863 ↓ 8.3 53,969 1

Sort (cost=401,150.37..401,166.61 rows=6,494 width=4) (actual time=20,868.466..20,874.863 rows=53,969 loops=1)

  • Sort Key: activity.object_id
  • Sort Method: quicksort Memory: 3896kB
  • Buffers: shared hit=93 read=249553 dirtied=7
9. 20,280.763 20,834.249 ↓ 8.3 53,969 1

Bitmap Heap Scan on activity (cost=94,944.50..400,739.14 rows=6,494 width=4) (actual time=564.985..20,834.249 rows=53,969 loops=1)

  • Recheck Cond: ((object_type)::text = 'task'::text)
  • Rows Removed by Index Recheck: 6982824
  • Filter: (verb = 21)
  • Rows Removed by Filter: 4138007
  • Heap Blocks: exact=48424 lossy=185157
  • Buffers: shared hit=93 read=249553 dirtied=7
10. 553.486 553.486 ↓ 1.0 4,191,976 1

Bitmap Index Scan on activity_object_type_object_id_idx (cost=0.00..94,942.88 rows=4,145,376 width=0) (actual time=553.486..553.486 rows=4,191,976 loops=1)

  • Index Cond: ((object_type)::text = 'task'::text)
  • Buffers: shared hit=93 read=15972
Planning time : 24.800 ms
Execution time : 22,558.663 ms