explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mvm9

Settings
# exclusive inclusive rows x rows loops node
1. 1.172 164.628 ↑ 1.0 1 1

Aggregate (cost=30,345.10..30,345.11 rows=1 width=8) (actual time=164.627..164.628 rows=1 loops=1)

2. 2.792 163.456 ↓ 20,339.0 20,339 1

Unique (cost=30,345.08..30,345.09 rows=1 width=4) (actual time=158.669..163.456 rows=20,339 loops=1)

3. 7.159 160.664 ↓ 20,339.0 20,339 1

Sort (cost=30,345.08..30,345.09 rows=1 width=4) (actual time=158.668..160.664 rows=20,339 loops=1)

  • Sort Key: clients_client.id
  • Sort Method: quicksort Memory: 1722kB
4. 3.736 153.505 ↓ 20,339.0 20,339 1

Gather (cost=14,688.38..30,345.07 rows=1 width=4) (actual time=72.334..153.505 rows=20,339 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
5. 0.736 149.769 ↓ 6,780.0 6,780 3 / 3

Nested Loop (cost=13,688.38..29,344.97 rows=1 width=4) (actual time=84.111..149.769 rows=6,780 loops=3)

6. 30.972 127.624 ↑ 1.4 7,136 3 / 3

Hash Semi Join (cost=13,687.96..24,394.34 rows=9,756 width=4) (actual time=84.093..127.624 rows=7,136 loops=3)

  • Hash Cond: (clients_groupassignment.id = u0.id)
7. 12.703 12.703 ↑ 1.2 156,443 3 / 3

Parallel Seq Scan on clients_groupassignment (cost=0.00..10,084.52 rows=195,552 width=8) (actual time=0.011..12.703 rows=156,443 loops=3)

8. 4.455 83.949 ↑ 1.1 21,409 3 / 3

Hash (cost=13,395.28..13,395.28 rows=23,414 width=4) (actual time=83.949..83.949 rows=21,409 loops=3)

  • Buckets: 32768 Batches: 1 Memory Usage: 1009kB
9. 2.091 79.494 ↑ 1.1 21,409 3 / 3

Nested Loop (cost=0.70..13,395.28 rows=23,414 width=4) (actual time=0.035..79.494 rows=21,409 loops=3)

10. 0.213 0.213 ↑ 1.0 249 3 / 3

Index Scan using accounts_employeegroup_447d3092 on accounts_employeegroup u1 (cost=0.28..137.71 rows=249 width=4) (actual time=0.012..0.213 rows=249 loops=3)

  • Index Cond: (company_id = 18855)
11. 77.190 77.190 ↑ 2.0 86 747 / 3

Index Scan using clients_groupassignment_group_id_692cd6dd on clients_groupassignment u0 (cost=0.42..51.52 rows=172 width=8) (actual time=0.026..0.310 rows=86 loops=747)

  • Index Cond: (group_id = u1.id)
  • Filter: ((last_communication_id IS NOT NULL) AND (status = ANY ('{10,15}'::integer[])))
  • Rows Removed by Filter: 313
12. 21.409 21.409 ↑ 1.0 1 21,409 / 3

Index Scan using clients_client_pkey on clients_client (cost=0.42..0.51 rows=1 width=4) (actual time=0.003..0.003 rows=1 loops=21,409)

  • Index Cond: (id = clients_groupassignment.client_id)
  • Filter: ((status <> ALL ('{50,70}'::integer[])) AND (brokerage_id = 18855))
  • Rows Removed by Filter: 0
Planning time : 0.843 ms
Execution time : 164.748 ms