explain.depesz.com

PostgreSQL's explain analyze made readable

Result: TbH1

Settings
# exclusive inclusive rows x rows loops node
1. 37.030 485.679 ↓ 1.4 20,074 1

Hash Semi Join (cost=100,563.34..121,332.70 rows=14,666 width=810) (actual time=420.989..485.679 rows=20,074 loops=1)

  • Hash Cond: (doc.id = v.document_id)
2. 27.789 27.789 ↓ 1.0 20,074 1

Seq Scan on document doc (cost=0.00..14,647.69 rows=20,012 width=810) (actual time=0.006..27.789 rows=20,074 loops=1)

  • Filter: (project_id = 104)
  • Rows Removed by Filter: 102,701
3. 43.957 420.860 ↓ 1.4 459,070 1

Hash (cost=95,082.69..95,082.69 rows=334,052 width=8) (actual time=420.860..420.860 rows=459,070 loops=1)

  • Buckets: 131,072 Batches: 8 Memory Usage: 3,231kB
4. 125.775 376.903 ↓ 1.4 459,070 1

Hash Join (cost=25,056.08..95,082.69 rows=334,052 width=8) (actual time=91.674..376.903 rows=459,070 loops=1)

  • Hash Cond: (vcl.version_id = v.id)
5. 163.242 188.393 ↓ 1.4 459,070 1

Bitmap Heap Scan on vcl (cost=10,694.48..72,356.88 rows=334,052 width=8) (actual time=28.761..188.393 rows=459,070 loops=1)

  • Recheck Cond: ((profile_id IS NULL) OR (profile_id = ANY ('{144,155,1492,1948,146,2012,149,147,153,150,1493,2286}'::bigint[])))
  • Filter: ((office_id IS NULL) OR (office_id = 119))
  • Rows Removed by Filter: 129,610
  • Heap Blocks: exact=32,190
6. 0.000 25.151 ↓ 0.0 0 1

BitmapOr (cost=10,694.48..10,694.48 rows=586,378 width=0) (actual time=25.151..25.151 rows=0 loops=1)

7. 0.679 0.679 ↓ 1.0 15,385 1

Bitmap Index Scan on vcl_profile_idx (cost=0.00..274.49 rows=14,674 width=0) (actual time=0.679..0.679 rows=15,385 loops=1)

  • Index Cond: (profile_id IS NULL)
8. 24.472 24.472 ↓ 1.0 573,295 1

Bitmap Index Scan on vcl_profile_idx (cost=0.00..10,252.97 rows=571,705 width=0) (actual time=24.472..24.472 rows=573,295 loops=1)

  • Index Cond: (profile_id = ANY ('{144,155,1492,1948,146,2012,149,147,153,150,1493,2286}'::bigint[]))
9. 26.857 62.735 ↑ 1.0 237,760 1

Hash (cost=10,228.60..10,228.60 rows=237,760 width=16) (actual time=62.735..62.735 rows=237,760 loops=1)

  • Buckets: 131,072 Batches: 4 Memory Usage: 3,817kB
10. 35.878 35.878 ↑ 1.0 237,760 1

Seq Scan on version v (cost=0.00..10,228.60 rows=237,760 width=16) (actual time=0.006..35.878 rows=237,760 loops=1)

Planning time : 0.582 ms
Execution time : 486.218 ms