explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 12fZ

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 62,388.362 121,155.702 ↓ 0.0 14,445,816 1

Sort (cost=0..0 rows=0 width=0) (actual time=115,769.874..121,155.702 rows=14,445,816 loops=1)

  • Sort Key: e.subject_id, t.user_company_code
  • Sort Method: external merge Disk: 1807416kB
2. 37,121.749 58,767.340 ↓ 0.0 14,445,816 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual time=3,070.736..58,767.340 rows=14,445,816 loops=1)

3. 1,197.610 13,624.699 ↓ 0.0 729,172 1

Hash Join (cost=0..0 rows=0 width=0) (actual time=3,070.382..13,624.699 rows=729,172 loops=1)

  • Hash Cond: ((e.subject_id)::bigint = (sub.entity_id)::bigint)
4. 9,400.587 9,671.792 ↓ 0.0 729,172 1

Bitmap Heap Scan on r_statement e (cost=0..0 rows=0 width=0) (actual time=302.336..9,671.792 rows=729,172 loops=1)

  • Recheck Cond: (((object_id)::bigint = 346965) AND ((predicate_id)::bigint = 3))
  • Heap Blocks: exact=97603
5. 271.205 271.205 ↓ 0.0 729,172 1

Bitmap Index Scan on idx_r_statement_object_predicate_subject (cost=0..0 rows=0 width=0) (actual time=271.205..271.205 rows=729,172 loops=1)

  • Index Cond: (((object_id)::bigint = 346965) AND ((predicate_id)::bigint = 3))
6. 1,196.814 2,755.297 ↓ 0.0 1,781,498 1

Hash (cost=0..0 rows=0 width=0) (actual time=2,755.297..2,755.297 rows=1,781,498 loops=1)

  • Buckets: 2097152 Batches: 1 Memory Usage: 230436kB
7. 1,558.483 1,558.483 ↓ 0.0 1,781,498 1

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

8. 8,020.892 8,020.892 ↓ 0.0 20 729,172

Index Only Scan using t_type_company_pkey on t_type_company t (cost=0..0 rows=0 width=0) (actual time=0.003..0.011 rows=20 loops=729,172)

  • Index Cond: (type_id = (_entity_class_id(e.subject_id, ('6'::bigint)::d_entityid))::bigint)
  • Heap Fetches: 14445652
Planning time : 15.881 ms
Execution time : 125,814.967 ms