explain.depesz.com

PostgreSQL's explain analyze made readable

Result: b7nW

Settings
# exclusive inclusive rows x rows loops node
1. 68,016.207 233,878.462 ↓ 0.0 14,445,816 1

Sort (cost=0..0 rows=0 width=0) (actual time=226,825.407..233,878.462 rows=14,445,816 loops=1)

  • Sort Key: e.subject_id, t.user_company_code
  • Sort Method: external merge Disk: 1807480kB
2. 25,890.985 165,862.255 ↓ 0.0 14,445,816 1

Nested Loop (cost=0..0 rows=0 width=0) (actual time=3,294.273..165,862.255 rows=14,445,816 loops=1)

  • Join Filter: ((et.subject_id)::bigint = (e.subject_id)::bigint)
3. 7,752.801 52,847.964 ↓ 0.0 14,520,551 1

Hash Left Join (cost=0..0 rows=0 width=0) (actual time=3,286.837..52,847.964 rows=14,520,551 loops=1)

  • Hash Cond: ((et.object_id)::bigint = (t.type_id)::bigint)
4. 2,200.406 45,091.874 ↓ 0.0 803,907 1

Hash Join (cost=0..0 rows=0 width=0) (actual time=3,283.504..45,091.874 rows=803,907 loops=1)

  • Hash Cond: ((et.subject_id)::bigint = (sub.entity_id)::bigint)
5. 39,621.198 39,849.487 ↓ 0.0 803,907 1

Bitmap Heap Scan on r_statement et (cost=0..0 rows=0 width=0) (actual time=239.877..39,849.487 rows=803,907 loops=1)

  • Recheck Cond: ((predicate_id)::bigint = 6)
  • Rows Removed by Index Recheck: 7895321
  • Heap Blocks: exact=28976 lossy=79271
6. 228.289 228.289 ↓ 0.0 803,907 1

Bitmap Index Scan on idx_r_statement_predicate (cost=0..0 rows=0 width=0) (actual time=228.289..228.289 rows=803,907 loops=1)

  • Index Cond: ((predicate_id)::bigint = 6)
7. 1,816.816 3,041.981 ↓ 0.0 1,781,498 1

Hash (cost=0..0 rows=0 width=0) (actual time=3,041.980..3,041.981 rows=1,781,498 loops=1)

  • Buckets: 32768 Batches: 64 Memory Usage: 3632kB
8. 1,225.165 1,225.165 ↓ 0.0 1,781,498 1

Seq Scan on m_entity sub (cost=0..0 rows=0 width=0) (actual time=0.019..1,225.165 rows=1,781,498 loops=1)

9. 1.767 3.289 ↓ 0.0 3,051 1

Hash (cost=0..0 rows=0 width=0) (actual time=3.288..3.289 rows=3,051 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 193kB
10. 1.522 1.522 ↓ 0.0 3,051 1

Seq Scan on t_type_company t (cost=0..0 rows=0 width=0) (actual time=0.039..1.522 rows=3,051 loops=1)

11. 87,123.306 87,123.306 ↓ 0.0 1 14,520,551

Index Only Scan using idx_r_statement_object_predicate_subject on r_statement e (cost=0..0 rows=0 width=0) (actual time=0.006..0.006 rows=1 loops=14,520,551)

  • Index Cond: ((object_id = 346965) AND (predicate_id = 3) AND (subject_id = (sub.entity_id)::bigint))
  • Heap Fetches: 14445816
Planning time : 0.948 ms
Execution time : 255,482.857 ms