explain.depesz.com

PostgreSQL's explain analyze made readable

Result: lRPk

Settings
# exclusive inclusive rows x rows loops node
1. 14.620 1,233.394 ↓ 14.0 8,249 1

Hash Join (cost=1,521,358.16..1,524,039.46 rows=591 width=1,068) (actual time=57.715..1,233.394 rows=8,249 loops=1)

  • Hash Cond: ((entities.entity_category)::text = (ecat.nsa_code)::text)
2.          

CTE live_orgs

3. 0.032 0.045 ↓ 8.5 93 1

Bitmap Heap Scan on organisation_extended_funcs (cost=4.37..15.04 rows=11 width=4) (actual time=0.019..0.045 rows=93 loops=1)

  • Recheck Cond: (extended_function_id = 14)
  • Heap Blocks: exact=3
4. 0.013 0.013 ↓ 8.5 93 1

Bitmap Index Scan on organisation_extended_funcs_pkey (cost=0.00..4.36 rows=11 width=0) (actual time=0.012..0.013 rows=93 loops=1)

  • Index Cond: (extended_function_id = 14)
5.          

CTE entities

6. 855.423 1,187.134 ↑ 14.2 8,332 1

Hash Left Join (cost=415,085.13..1,521,332.61 rows=118,220 width=647) (actual time=57.664..1,187.134 rows=8,332 loops=1)

  • Hash Cond: (d.publisher_organisation_id = live_orgs.organisation_id)
7. 6.699 331.590 ↑ 14.2 8,332 1

Hash Join (cost=415,084.77..1,045,284.94 rows=118,220 width=439) (actual time=57.195..331.590 rows=8,332 loops=1)

  • Hash Cond: (d.impact_score = ei.impact_score)
8. 6.734 324.880 ↑ 14.2 8,332 1

Hash Join (cost=415,067.12..1,044,953.09 rows=118,220 width=351) (actual time=57.178..324.880 rows=8,332 loops=1)

  • Hash Cond: (d.responsible_org_orgref = resporg.swa_org_ref)
9. 7.647 317.315 ↑ 14.2 8,333 1

Hash Join (cost=415,014.67..1,044,589.31 rows=118,220 width=329) (actual time=56.340..317.315 rows=8,333 loops=1)

  • Hash Cond: (d.publisher_orgref = publisher.swa_org_ref)
10. 259.742 308.857 ↑ 14.2 8,334 1

Bitmap Heap Scan on entity d (cost=414,962.21..1,044,225.53 rows=118,220 width=307) (actual time=55.520..308.857 rows=8,334 loops=1)

  • Recheck Cond: (entity_type > 1)
  • Rows Removed by Index Recheck: 5614
  • Filter: (active AND (published = 1) AND (end_date >= LOCALTIMESTAMP) AND (LOCALTIMESTAMP > publish_date) AND (end_date >= (CURRENT_DATE)::timestamp without time zone) AND (start_date <= ((CURRENT_DATE + '1 day'::interval) - '00:00:01'::interval)))
  • Rows Removed by Filter: 373168
  • Heap Blocks: exact=37085 lossy=34479
11. 49.115 49.115 ↑ 1.0 217,891 1

Bitmap Index Scan on idx_entity_type_active (cost=0.00..414,932.66 rows=227,124 width=0) (actual time=49.115..49.115 rows=217,891 loops=1)

  • Index Cond: ((entity_type > 1) AND (active = true))
12. 0.398 0.811 ↑ 1.0 1,309 1

Hash (cost=36.09..36.09 rows=1,309 width=26) (actual time=0.811..0.811 rows=1,309 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 82kB
13. 0.413 0.413 ↑ 1.0 1,309 1

Seq Scan on orgref publisher (cost=0.00..36.09 rows=1,309 width=26) (actual time=0.002..0.413 rows=1,309 loops=1)

14. 0.394 0.831 ↑ 1.0 1,309 1

Hash (cost=36.09..36.09 rows=1,309 width=26) (actual time=0.831..0.831 rows=1,309 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 82kB
15. 0.437 0.437 ↑ 1.0 1,309 1

Seq Scan on orgref resporg (cost=0.00..36.09 rows=1,309 width=26) (actual time=0.002..0.437 rows=1,309 loops=1)

16. 0.005 0.011 ↑ 68.0 5 1

Hash (cost=13.40..13.40 rows=340 width=92) (actual time=0.010..0.011 rows=5 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
17. 0.006 0.006 ↑ 68.0 5 1

Seq Scan on eton_impact ei (cost=0.00..13.40 rows=340 width=92) (actual time=0.004..0.006 rows=5 loops=1)

18. 0.027 0.121 ↓ 8.5 93 1

Hash (cost=0.22..0.22 rows=11 width=4) (actual time=0.120..0.121 rows=93 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
19. 0.094 0.094 ↓ 8.5 93 1

CTE Scan on live_orgs (cost=0.00..0.22 rows=11 width=4) (actual time=0.021..0.094 rows=93 loops=1)

20. 1,218.738 1,218.738 ↑ 14.2 8,332 1

CTE Scan on entities (cost=0.00..2,364.40 rows=118,220 width=1,068) (actual time=57.670..1,218.738 rows=8,332 loops=1)

21. 0.012 0.036 ↓ 31.0 31 1

Hash (cost=10.50..10.50 rows=1 width=118) (actual time=0.036..0.036 rows=31 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
22. 0.024 0.024 ↓ 31.0 31 1

Seq Scan on entity_category ecat (cost=0.00..10.50 rows=1 width=118) (actual time=0.008..0.024 rows=31 loops=1)

  • Filter: ((entitygroupid)::text = 'RW'::text)
  • Rows Removed by Filter: 61