explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HVSg

Settings
# exclusive inclusive rows x rows loops node
1. 1.642 1,150.015 ↑ 1.0 5,000 1

Limit (cost=2,828.56..1,834,192.75 rows=5,000 width=2,523) (actual time=0.353..1,150.015 rows=5,000 loops=1)

2. 581.616 1,148.373 ↑ 111.4 5,000 1

Result (cost=2,828.56..203,939,150.38 rows=556,788 width=2,523) (actual time=0.352..1,148.373 rows=5,000 loops=1)

3. 43.377 536.757 ↑ 111.4 5,000 1

Unique (cost=2,828.56..9,296,072.39 rows=556,788 width=2,503) (actual time=0.031..536.757 rows=5,000 loops=1)

4. 301.142 493.380 ↑ 31.6 553,722 1

Merge Left Join (cost=2,828.56..9,252,299.04 rows=17,509,339 width=2,503) (actual time=0.027..493.380 rows=553,722 loops=1)

  • Merge Cond: (e.entity_id = i.entity_id)
5. 34.618 34.618 ↑ 49.3 35,461 1

Index Scan using idx_entity_raw_entity_id on entity_raw e (cost=0.43..3,114,543.54 rows=1,748,183 width=2,498) (actual time=0.007..34.618 rows=35,461 loops=1)

  • Filter: (entity_type = 2)
6. 92.847 157.620 ↑ 10.2 552,761 1

Materialize (cost=0.43..6,047,603.42 rows=5,665,229 width=16) (actual time=0.012..157.620 rows=552,761 loops=1)

7. 64.773 64.773 ↑ 65.0 87,177 1

Index Scan Backward using idx_item_raw_entity_id on item_raw i (cost=0.43..6,033,440.35 rows=5,665,229 width=16) (actual time=0.009..64.773 rows=87,177 loops=1)

8.          

SubPlan (forResult)

9. 5.000 20.000 ↓ 0.0 0 5,000

GroupAggregate (cost=0.57..340.37 rows=84 width=16) (actual time=0.004..0.004 rows=0 loops=5,000)

  • Group Key: csl.entity_id
10. 15.000 15.000 ↑ 84.0 1 5,000

Index Scan using idx_log_daily_agg_by_worksref_entity_id on log_daily_agg_by_worksref csl (cost=0.57..339.11 rows=84 width=12) (actual time=0.003..0.003 rows=1 loops=5,000)

  • Index Cond: (entity_id = e.entity_id)
11. 5.000 10.000 ↑ 1.0 1 5,000

Aggregate (cost=8.44..8.45 rows=1 width=2) (actual time=0.002..0.002 rows=1 loops=5,000)

12. 5.000 5.000 ↓ 0.0 0 5,000

Index Scan using tomtom_max_impact_xref_entity_id_pkey on tomtom_max_impact_xref_entity_id tt (cost=0.42..8.44 rows=1 width=2) (actual time=0.001..0.001 rows=0 loops=5,000)

  • Index Cond: (entity_id = e.entity_id)