explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Wee4

Settings
# exclusive inclusive rows x rows loops node
1. 51,101.092 184,098.397 ↓ 0.0 14,445,816 1

Sort (cost=0..0 rows=0 width=0) (actual time=175,577.198..184,098.397 rows=14,445,816 loops=1)

  • Sort Key: e.subject_id, t.user_company_code
  • Sort Method: external sort Disk: 1807424kB
2. 11,087.228 132,997.305 ↓ 0.0 14,445,816 1

Merge Join (cost=0..0 rows=0 width=0) (actual time=102,318.206..132,997.305 rows=14,445,816 loops=1)

  • Merge Cond: ((e.subject_id)::bigint = (et.subject_id)::bigint)
3. 1,309.921 59,626.983 ↓ 0.0 729,172 1

Merge Join (cost=0..0 rows=0 width=0) (actual time=55,441.821..59,626.983 rows=729,172 loops=1)

  • Merge Cond: ((sub.entity_id)::bigint = (e.subject_id)::bigint)
4. 2,540.459 2,540.459 ↓ 0.0 1,781,498 1

Index Scan using pk_m_entity on m_entity sub (cost=0..0 rows=0 width=0) (actual time=0.008..2,540.459 rows=1,781,498 loops=1)

5. 1,231.775 55,776.603 ↓ 0.0 729,172 1

Sort (cost=0..0 rows=0 width=0) (actual time=55,349.171..55,776.603 rows=729,172 loops=1)

  • Sort Key: e.subject_id
  • Sort Method: external sort Disk: 15688kB
6. 54,314.868 54,544.828 ↓ 0.0 729,172 1

Bitmap Heap Scan on r_statement e (cost=0..0 rows=0 width=0) (actual time=240.453..54,544.828 rows=729,172 loops=1)

  • Recheck Cond: (((object_id)::bigint = 346965) AND ((predicate_id)::bigint = 3))
  • Rows Removed by Index Recheck: 5253057
  • Heap Blocks: exact=44350 lossy=53253
7. 229.960 229.960 ↓ 0.0 729,172 1

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

  • Index Cond: (((object_id)::bigint = 346965) AND ((predicate_id)::bigint = 3))
8. 7,320.816 62,283.094 ↓ 0.0 14,520,551 1

Materialize (cost=0..0 rows=0 width=0) (actual time=46,876.376..62,283.094 rows=14,520,551 loops=1)

9. 27,749.918 54,962.278 ↓ 0.0 14,520,551 1

Sort (cost=0..0 rows=0 width=0) (actual time=46,876.369..54,962.278 rows=14,520,551 loops=1)

  • Sort Key: et.subject_id
  • Sort Method: external merge Disk: 399000kB
10. 7,303.982 27,212.360 ↓ 0.0 14,520,551 1

Merge Right Join (cost=0..0 rows=0 width=0) (actual time=15,199.209..27,212.360 rows=14,520,551 loops=1)

  • Merge Cond: ((t.type_id)::bigint = (et.object_id)::bigint)
11. 5.718 5.718 ↓ 0.0 3,051 1

Index Only Scan using t_type_company_pkey on t_type_company t (cost=0..0 rows=0 width=0) (actual time=0.035..5.718 rows=3,051 loops=1)

  • Heap Fetches: 3051
12. 4,354.309 19,902.660 ↓ 0.0 14,520,551 1

Materialize (cost=0..0 rows=0 width=0) (actual time=15,199.170..19,902.660 rows=14,520,551 loops=1)

13. 791.447 15,548.351 ↓ 0.0 803,907 1

Sort (cost=0..0 rows=0 width=0) (actual time=15,199.164..15,548.351 rows=803,907 loops=1)

  • Sort Key: et.object_id
  • Sort Method: external merge Disk: 20360kB
14. 14,583.815 14,756.904 ↓ 0.0 803,907 1

Bitmap Heap Scan on r_statement et (cost=0..0 rows=0 width=0) (actual time=179.185..14,756.904 rows=803,907 loops=1)

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

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

  • Index Cond: ((predicate_id)::bigint = 6)
Planning time : 31.582 ms
Execution time : 190,104.142 ms