explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LWnO : Optimization for: plan #12fZ

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 45,255.167 94,696.050 ↓ 0.0 14,445,816 1

Sort (cost=0..0 rows=0 width=0) (actual time=90,740.610..94,696.050 rows=14,445,816 loops=1)

  • Sort Key: e.subject_id, t.user_company_code
  • Sort Method: quicksort Memory: 3648859kB
2. 33,469.648 49,440.883 ↓ 0.0 14,445,816 1

Nested Loop Left Join (cost=0..0 rows=0 width=0) (actual time=2,999.350..49,440.883 rows=14,445,816 loops=1)

3. 1,205.036 7,950.343 ↓ 0.0 729,172 1

Hash Join (cost=0..0 rows=0 width=0) (actual time=2,998.951..7,950.343 rows=729,172 loops=1)

  • Hash Cond: ((e.subject_id)::bigint = (sub.entity_id)::bigint)
4. 3,780.050 4,025.144 ↓ 0.0 729,172 1

Bitmap Heap Scan on r_statement e (cost=0..0 rows=0 width=0) (actual time=267.933..4,025.144 rows=729,172 loops=1)

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

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

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

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

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

Seq Scan on m_entity sub (cost=0..0 rows=0 width=0) (actual time=0.014..1,498.891 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 : 0.351 ms
Execution time : 98,627.084 ms