explain.depesz.com

PostgreSQL's explain analyze made readable

Result: M4up

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 1,302.435 ↑ 1.0 1 1

Aggregate (cost=69,582.29..69,582.30 rows=1 width=8) (actual time=1,302.435..1,302.435 rows=1 loops=1)

2. 27.162 1,310.421 ↓ 75,072.0 75,072 1

Gather (cost=1,004.18..69,582.29 rows=1 width=4) (actual time=6.827..1,310.421 rows=75,072 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 875.450 1,283.259 ↓ 25,024.0 25,024 3

Nested Loop Left Join (cost=4.18..68,582.19 rows=1 width=4) (actual time=7.583..1,283.259 rows=25,024 loops=3)

  • Filter: (am.id IS NULL)
  • Rows Removed by Filter: 338971
4. 154.813 407.807 ↓ 8.3 363,995 3

Hash Join (cost=3.75..47,607.62 rows=43,646 width=4) (actual time=0.274..407.807 rows=363,995 loops=3)

  • Hash Cond: (sm.location_dest_id = sld.id)
  • Join Filter: ((((sl.usage)::text <> ALL ('{internal,transit}'::text[])) AND ((sld.usage)::text = ANY ('{internal,transit}'::text[]))) OR (((sl.usage)::text = ANY ('{internal,transit}'::text[])) AND ((sld.usage)::text <> ALL ('{internal,transit}'::text[]))) OR (((sl.usage)::text = 'customer'::text) AND ((sld.usage)::text = 'supplier'::text)) OR (((sl.usage)::text = 'supplier'::text) AND ((sld.usage)::text = 'customer'::text)))
5. 93.583 252.925 ↑ 1.2 363,995 3

Hash Join (cost=1.88..46,379.04 rows=454,047 width=40) (actual time=0.075..252.925 rows=363,995 loops=3)

  • Hash Cond: (sm.location_id = sl.id)
6. 159.302 159.302 ↑ 1.2 363,995 3

Parallel Seq Scan on stock_move sm (cost=0.00..45,055.78 rows=454,047 width=12) (actual time=0.019..159.302 rows=363,995 loops=3)

  • Filter: ((price_unit <> '0'::double precision) AND ((state)::text = 'done'::text))
  • Rows Removed by Filter: 6224
7. 0.020 0.040 ↑ 1.0 39 3

Hash (cost=1.39..1.39 rows=39 width=36) (actual time=0.040..0.040 rows=39 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
8. 0.020 0.020 ↑ 1.0 39 3

Seq Scan on stock_location sl (cost=0.00..1.39 rows=39 width=36) (actual time=0.005..0.020 rows=39 loops=3)

9. 0.026 0.069 ↑ 1.0 39 3

Hash (cost=1.39..1.39 rows=39 width=36) (actual time=0.069..0.069 rows=39 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
10. 0.043 0.043 ↑ 1.0 39 3

Seq Scan on stock_location sld (cost=0.00..1.39 rows=39 width=36) (actual time=0.028..0.043 rows=39 loops=3)

11. 0.002 0.002 ↑ 1.0 1 1,091,984

Index Scan using account_move_stock_move_id_index on account_move am (cost=0.43..0.47 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=1,091,984)

  • Index Cond: (stock_move_id = sm.id)
Planning time : 1.283 ms
Execution time : 1,318.143 ms