explain.depesz.com

PostgreSQL's explain analyze made readable

Result: bhQ3

Settings
# exclusive inclusive rows x rows loops node
1. 14.380 83,540.413 ↑ 1.0 2 1

Limit (cost=179,949.23..180,187.81 rows=2 width=337) (actual time=83,525.513..83,540.413 rows=2 loops=1)

2. 2,405.305 83,526.033 ↑ 78.0 1,502 1

Nested Loop (cost=1,014.00..13,973,469.47 rows=117,130 width=337) (actual time=59,546.231..83,526.033 rows=1,502 loops=1)

  • Join Filter: (orders_order.seller_id = companies_company.id)
  • Rows Removed by Join Filter: 2047327
3. 0.000 81,120.728 ↑ 2.4 2,048,829 1

Gather Merge (cost=1,000.88..13,901,047.19 rows=4,826,742 width=318) (actual time=37.702..81,120.728 rows=2,048,829 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 4,238.240 124,920.120 ↑ 2.9 683,007 3

Nested Loop (cost=0.86..13,342,921.37 rows=2,011,142 width=318) (actual time=1.953..41,640.040 rows=683,007 loops=3)

5. 79,701.480 79,701.480 ↑ 2.9 683,007 3

Parallel Index Scan using orders_orderedproduct_pkey on orders_orderedproduct (cost=0.43..3,176,124.27 rows=2,011,142 width=314) (actual time=1.342..26,567.160 rows=683,007 loops=3)

6. 40,980.400 40,980.400 ↑ 1.0 1 2,049,020

Index Scan using orders_order_pkey on orders_order (cost=0.42..5.06 rows=1 width=12) (actual time=0.020..0.020 rows=1 loops=2,049,020)

  • Index Cond: (id = orders_orderedproduct.order_id)
7. 0.000 0.000 ↑ 1.0 1 2,048,829

Materialize (cost=13.12..21.15 rows=1 width=27) (actual time=0.000..0.000 rows=1 loops=2,048,829)

8. 0.002 0.141 ↑ 1.0 1 1

Nested Loop (cost=13.12..21.15 rows=1 width=27) (actual time=0.140..0.141 rows=1 loops=1)

9. 0.017 0.081 ↑ 1.0 1 1

HashAggregate (cost=12.83..12.84 rows=1 width=4) (actual time=0.078..0.081 rows=1 loops=1)

  • Group Key: v1.company_id
10. 0.003 0.064 ↓ 2.0 2 1

Nested Loop (cost=0.70..12.83 rows=1 width=4) (actual time=0.058..0.064 rows=2 loops=1)

11. 0.023 0.023 ↑ 1.0 1 1

Index Scan using companies_companystaff_user_id_53dfec4355f77324_uniq on companies_companystaff v1 (cost=0.29..8.30 rows=1 width=8) (actual time=0.021..0.023 rows=1 loops=1)

  • Index Cond: (user_id = 17134)
  • Filter: is_active
12. 0.038 0.038 ↓ 2.0 2 1

Index Only Scan using companies_companystaffpermis_staff_user_id_2c60b342bb3387f_uniq on companies_companystaffpermission u2 (cost=0.42..4.52 rows=1 width=4) (actual time=0.033..0.038 rows=2 loops=1)

  • Index Cond: (staff_user_id = v1.id)
  • Filter: ((permission_id)::text = ANY ('{can_manage_orders_received,can_manage_crm}'::text[]))
  • Rows Removed by Filter: 7
  • Heap Fetches: 0
13. 0.058 0.058 ↑ 1.0 1 1

Index Scan using companies_company_pkey on companies_company (cost=0.29..8.30 rows=1 width=23) (actual time=0.058..0.058 rows=1 loops=1)

  • Index Cond: (id = v1.company_id)
Planning time : 10.453 ms
Execution time : 83,541.469 ms