explain.depesz.com

PostgreSQL's explain analyze made readable

Result: gUEV

Settings
# exclusive inclusive rows x rows loops node
1. 299.298 20,391.992 ↓ 1,433.0 2,866 1

Gather (cost=129,907.79..130,667.76 rows=2 width=64) (actual time=15,471.285..20,391.992 rows=2,866 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
2. 6.334 20,092.694 ↓ 955.0 955 3 / 3

Nested Loop (cost=128,907.79..129,667.56 rows=1 width=64) (actual time=15,511.919..20,092.694 rows=955 loops=3)

  • Join Filter: (ciw.investment_id = li_1.id)
3. 1,935.746 20,081.583 ↑ 1.0 955 3 / 3

Merge Join (cost=128,907.36..129,230.19 rows=957 width=36) (actual time=15,511.878..20,081.583 rows=955 loops=3)

  • Merge Cond: ((pi.investment_list_id = ciw.investment_id) AND (c_1.id = ciw.client_id))
4. 8,574.522 18,130.467 ↓ 57.7 2,226,864 3 / 3

Sort (cost=128,644.10..128,740.59 rows=38,598 width=28) (actual time=15,495.557..18,130.467 rows=2,226,864 loops=3)

  • Sort Key: pi.investment_list_id, c_1.id
  • Sort Method: external merge Disk: 55,072kB
  • Worker 0: Sort Method: external merge Disk: 58,112kB
  • Worker 1: Sort Method: external merge Disk: 54,488kB
5. 6,608.211 9,555.945 ↓ 57.7 2,226,864 3 / 3

Parallel Hash Join (cost=6,259.58..125,703.66 rows=38,598 width=28) (actual time=5,827.089..9,555.945 rows=2,226,864 loops=3)

  • Hash Cond: (pi.plan_id = big_plans.id)
6. 1,986.495 1,986.495 ↑ 1.3 2,272,526 3 / 3

Parallel Seq Scan on plan_investments pi (cost=0.00..108,564.58 rows=2,840,658 width=28) (actual time=0.025..1,986.495 rows=2,272,526 loops=3)

7. 252.419 961.239 ↓ 37.7 100,357 3 / 3

Parallel Hash (cost=6,226.32..6,226.32 rows=2,661 width=8) (actual time=961.239..961.239 rows=100,357 loops=3)

  • Buckets: 65,536 (originally 8192) Batches: 8 (originally 1) Memory Usage: 2,016kB
8. 141.432 708.820 ↓ 37.7 100,357 3 / 3

Nested Loop (cost=1,921.40..6,226.32 rows=2,661 width=8) (actual time=110.256..708.820 rows=100,357 loops=3)

9. 15.349 198.464 ↓ 152.9 5,506 3 / 3

Hash Join (cost=1,920.98..3,833.48 rows=36 width=8) (actual time=110.199..198.464 rows=5,506 loops=3)

  • Hash Cond: (companies.id = c_1.company_id)
10. 15.162 179.641 ↓ 7.9 5,506 3 / 3

Nested Loop (cost=1,799.54..3,710.20 rows=699 width=12) (actual time=106.708..179.641 rows=5,506 loops=3)

11. 14.373 125.935 ↓ 7.9 5,506 3 / 3

Hash Join (cost=1,799.12..2,995.95 rows=699 width=8) (actual time=106.665..125.935 rows=5,506 loops=3)

  • Hash Cond: (users.person_id = people.id)
12. 6.544 6.544 ↓ 7.9 5,542 3 / 3

Parallel Seq Scan on users (cost=0.00..1,194.99 rows=699 width=8) (actual time=0.009..6.544 rows=5,542 loops=3)

13. 50.383 105.018 ↑ 1.0 49,650 3 / 3

Hash (cost=1,178.50..1,178.50 rows=49,650 width=8) (actual time=105.017..105.018 rows=49,650 loops=3)

  • Buckets: 65,536 Batches: 1 Memory Usage: 2,452kB
14. 54.635 54.635 ↑ 1.0 49,650 3 / 3

Seq Scan on people (cost=0.00..1,178.50 rows=49,650 width=8) (actual time=0.013..54.635 rows=49,650 loops=3)

15. 38.544 38.544 ↑ 1.0 1 16,519 / 3

Index Only Scan using companies_pkey on companies (cost=0.41..1.02 rows=1 width=4) (actual time=0.007..0.007 rows=1 loops=16,519)

  • Index Cond: (id = people.company_id)
  • Heap Fetches: 2,494
16. 1.930 3.474 ↓ 4.7 3,023 3 / 3

Hash (cost=113.42..113.42 rows=642 width=8) (actual time=3.473..3.474 rows=3,023 loops=3)

  • Buckets: 4,096 (originally 1024) Batches: 1 (originally 1) Memory Usage: 151kB
17. 1.544 1.544 ↓ 4.7 3,023 3 / 3

Seq Scan on clients c_1 (cost=0.00..113.42 rows=642 width=8) (actual time=0.012..1.544 rows=3,023 loops=3)

18. 368.924 368.924 ↑ 4.1 18 16,519 / 3

Index Scan using big_plans__user_id_owner_idx on big_plans (cost=0.42..65.74 rows=73 width=8) (actual time=0.011..0.067 rows=18 loops=16,519)

  • Index Cond: (user_id_owner = users.id)
  • Filter: is_active_client_plan
  • Rows Removed by Filter: 2
19. 12.404 15.370 ↓ 1.1 3,498 3 / 3

Sort (cost=263.27..271.20 rows=3,173 width=12) (actual time=8.106..15.370 rows=3,498 loops=3)

  • Sort Key: ciw.investment_id, ciw.client_id
  • Sort Method: quicksort Memory: 245kB
  • Worker 0: Sort Method: quicksort Memory: 245kB
  • Worker 1: Sort Method: quicksort Memory: 245kB
20. 2.966 2.966 ↑ 1.0 3,173 3 / 3

Seq Scan on client_investment_watches ciw (cost=0.00..78.73 rows=3,173 width=12) (actual time=0.032..2.966 rows=3,173 loops=3)

21. 4.777 4.777 ↑ 1.0 1 2,866 / 3

Index Scan using investment_lists_pkey on investment_lists li_1 (cost=0.42..0.44 rows=1 width=36) (actual time=0.005..0.005 rows=1 loops=2,866)

  • Index Cond: (id = pi.investment_list_id)
Planning time : 19.589 ms
Execution time : 34,822.067 ms