explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Fq2i

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 1.463 3,399.551 ↑ 1.0 1 1

Aggregate (cost=86,581.06..86,581.07 rows=1 width=4) (actual time=3,399.551..3,399.551 rows=1 loops=1)

2. 13.973 3,398.088 ↓ 2.6 14,044 1

Nested Loop (cost=83,976.21..86,567.34 rows=5,486 width=4) (actual time=3,285.271..3,398.088 rows=14,044 loops=1)

  • Join Filter: (worksite0_.id = worksite1_.id)
3. 341.404 3,299.851 ↓ 2.6 14,044 1

HashAggregate (cost=83,975.79..84,030.65 rows=5,486 width=28) (actual time=3,285.223..3,299.851 rows=14,044 loops=1)

4. 837.079 2,958.447 ↓ 257.7 1,413,686 1

Nested Loop (cost=684.82..83,962.07 rows=5,486 width=28) (actual time=8.664..2,958.447 rows=1,413,686 loops=1)

  • Join Filter: ((worksite1_.id = controlshe7_.worksite_id) AND (((controlshe2_.status)::text = 'CANCELLED'::text) OR ((controlshe3_.status)::text = 'CLOSED'::text) OR ((controlshe4_.status)::text = 'IN_PROGRESS'::text)
  • Rows Removed by Join Filter: 17956
5. 188.145 1,045.052 ↓ 44.9 358,772 1

Nested Loop (cost=684.40..79,944.69 rows=7,994 width=59) (actual time=8.659..1,045.052 rows=358,772 loops=1)

  • Join Filter: (worksite1_.id = controlshe6_.worksite_id)
6. 52.281 509.381 ↓ 11.3 115,842 1

Nested Loop (cost=683.97..74,941.94 rows=10,261 width=48) (actual time=8.656..509.381 rows=115,842 loops=1)

  • Join Filter: (worksite1_.id = controlshe5_.worksite_id)
7. 57.081 310.880 ↓ 3.7 48,740 1

Nested Loop (cost=683.55..68,520.90 rows=13,170 width=37) (actual time=8.653..310.880 rows=48,740 loops=1)

  • Join Filter: (worksite1_.id = controlshe4_.worksite_id)
8. 14.094 201.035 ↓ 1.6 26,382 1

Nested Loop (cost=683.13..60,278.87 rows=16,905 width=26) (actual time=8.650..201.035 rows=26,382 loops=1)

  • Join Filter: (worksite1_.id = controlshe3_.worksite_id)
9. 91.733 151.417 ↑ 1.2 17,762 1

Nested Loop (cost=682.71..49,699.52 rows=21,699 width=15) (actual time=8.644..151.417 rows=17,762 loops=1)

10. 0.000 59.684 ↑ 1.8 15,736 1

Hash Join (cost=682.28..22,811.84 rows=27,853 width=4) (actual time=8.620..59.684 rows=15,736 loops=1)

  • Hash Cond: (worksite1_.creator_id = abstractus8_.id)
11. 42.983 46.525 ↑ 2.1 15,759 1

Bitmap Heap Scan on worksite worksite1_ (cost=372.27..21,851.43 rows=33,055 width=8) (actual time=4.824..46.525 rows=15,759 loops=1)

  • Recheck Cond: ((supplier_id = 72) OR (supplier_id = 6) OR (supplier_id = 72))
12. 0.003 3.542 ↓ 0.0 0 1

BitmapOr (cost=372.27..372.27 rows=33,495 width=0) (actual time=3.542..3.542 rows=0 loops=1)

13. 2.292 2.292 ↑ 1.0 16,277 1

Bitmap Index Scan on idx_worksite_supplier_id (cost=0.00..168.76 rows=16,311 width=0) (actual time=2.292..2.292 rows=16,277 loops=1)

  • Index Cond: (supplier_id = 72)
14. 0.010 0.010 ↓ 0.0 0 1

Bitmap Index Scan on idx_worksite_supplier_id (cost=0.00..9.96 rows=872 width=0) (actual time=0.010..0.010 rows=0 loops=1)

  • Index Cond: (supplier_id = 6)
15. 1.237 1.237 ↑ 1.0 16,277 1

Bitmap Index Scan on idx_worksite_supplier_id (cost=0.00..168.76 rows=16,311 width=0) (actual time=1.237..1.237 rows=16,277 loops=1)

  • Index Cond: (supplier_id = 72)
16. 1.137 3.786 ↑ 1.0 6,764 1

Hash (cost=224.95..224.95 rows=6,805 width=4) (actual time=3.786..3.786 rows=6,764 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 238kB
17. 2.649 2.649 ↑ 1.0 6,764 1

Seq Scan on uuser abstractus8_ (cost=0.00..224.95 rows=6,805 width=4) (actual time=0.022..2.649 rows=6,764 loops=1)

  • Filter: ((usertype)::text = 'ORANGE'::text)
  • Rows Removed by Filter: 1261
18. 78.680 78.680 ↑ 1.0 1 15,736

Index Scan using idx_cs_ws_id on controlsheet controlshe2_ (cost=0.42..0.96 rows=1 width=11) (actual time=0.005..0.005 rows=1 loops=15,736)

  • Index Cond: (worksite_id = worksite1_.id)
19. 35.524 35.524 ↑ 1.0 1 17,762

Index Scan using idx_cs_ws_id on controlsheet controlshe3_ (cost=0.42..0.48 rows=1 width=11) (actual time=0.002..0.002 rows=1 loops=17,762)

  • Index Cond: (worksite_id = controlshe2_.worksite_id)
20. 52.764 52.764 ↓ 2.0 2 26,382

Index Scan using idx_cs_ws_id on controlsheet controlshe4_ (cost=0.42..0.48 rows=1 width=11) (actual time=0.002..0.002 rows=2 loops=26,382)

  • Index Cond: (worksite_id = controlshe2_.worksite_id)
21. 146.220 146.220 ↓ 2.0 2 48,740

Index Scan using idx_cs_ws_id on controlsheet controlshe5_ (cost=0.42..0.48 rows=1 width=11) (actual time=0.002..0.003 rows=2 loops=48,740)

  • Index Cond: (worksite_id = controlshe2_.worksite_id)
22. 347.526 347.526 ↓ 3.0 3 115,842

Index Scan using idx_cs_ws_id on controlsheet controlshe6_ (cost=0.42..0.48 rows=1 width=11) (actual time=0.002..0.003 rows=3 loops=115,842)

  • Index Cond: (worksite_id = controlshe2_.worksite_id)
23. 1,076.316 1,076.316 ↓ 4.0 4 358,772

Index Scan using idx_cs_ws_id on controlsheet controlshe7_ (cost=0.42..0.48 rows=1 width=11) (actual time=0.002..0.003 rows=4 loops=358,772)

  • Index Cond: (worksite_id = controlshe2_.worksite_id)
24. 84.264 84.264 ↑ 1.0 1 14,044

Index Only Scan using pk_worksite on worksite worksite0_ (cost=0.42..0.45 rows=1 width=4) (actual time=0.006..0.006 rows=1 loops=14,044)

  • Index Cond: (id = controlshe2_.worksite_id)
  • Heap Fetches: 1871