explain.depesz.com

PostgreSQL's explain analyze made readable

Result: D81h

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 258.862 ↑ 1.0 1 1

Aggregate (cost=10,622.31..10,622.32 rows=1 width=32) (actual time=258.862..258.862 rows=1 loops=1)

2. 167.600 264.788 ↑ 1.0 2 1

Gather (cost=10,622.08..10,622.30 rows=2 width=32) (actual time=44.095..264.788 rows=2 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
3. 0.001 97.188 ↑ 1.0 1 3 / 3

Parallel Append (cost=9,622.08..9,622.10 rows=1 width=32) (actual time=97.188..97.188 rows=1 loops=3)

4. 0.004 82.687 ↑ 1.0 1 1 / 3

Aggregate (cost=9,622.08..9,622.09 rows=1 width=32) (actual time=248.060..248.060 rows=1 loops=1)

5. 0.004 82.683 ↓ 17.0 17 1 / 3

Nested Loop (cost=6,479.36..9,622.07 rows=1 width=32) (actual time=247.673..248.048 rows=17 loops=1)

6. 0.162 82.560 ↑ 30.2 17 1 / 3

Bitmap Heap Scan on stock_move_line l (cost=6,478.79..8,193.36 rows=513 width=36) (actual time=247.608..247.679 rows=17 loops=1)

  • Recheck Cond: ((product_id = 80) AND (location_id = 397))
  • Filter: (date > '2019-01-24 14:47:40'::timestamp without time zone)
  • Rows Removed by Filter: 61
7. 0.935 82.398 ↓ 0.0 0 1 / 3

BitmapAnd (cost=6,478.79..6,478.79 rows=1,539 width=0) (actual time=247.193..247.193 rows=0 loops=1)

8. 0.206 0.206 ↑ 230.3 1,337 1 / 3

Bitmap Index Scan on stock_pack_operation_product_id_fkey_mig_idx (cost=0.00..3,239.14 rows=307,877 width=0) (actual time=0.617..0.617 rows=1,337 loops=1)

  • Index Cond: (product_id = 80)
9. 81.257 81.257 ↓ 10.7 3,303,183 1 / 3

Bitmap Index Scan on stock_pack_operation_location_id_fkey_mig_idx (cost=0.00..3,239.14 rows=307,877 width=0) (actual time=243.772..243.772 rows=3,303,183 loops=1)

  • Index Cond: (location_id = 397)
10. 0.119 0.119 ↑ 1.0 1 17 / 3

Index Scan using stock_move_pkey on stock_move m (cost=0.56..2.79 rows=1 width=4) (actual time=0.021..0.021 rows=1 loops=17)

  • Index Cond: (id = l.move_id)
  • Filter: ((inventory_id IS NULL) AND ((state)::text = 'done'::text))
11. 0.004 14.500 ↑ 1.0 1 1 / 3

Aggregate (cost=9,622.08..9,622.09 rows=1 width=32) (actual time=43.499..43.500 rows=1 loops=1)

12. 0.002 14.496 ↓ 2.0 2 1 / 3

Nested Loop (cost=6,479.36..9,622.07 rows=1 width=32) (actual time=43.486..43.489 rows=2 loops=1)

13. 0.023 14.474 ↑ 42.8 12 1 / 3

Bitmap Heap Scan on stock_move_line l_1 (cost=6,478.79..8,193.36 rows=513 width=36) (actual time=43.377..43.422 rows=12 loops=1)

  • Recheck Cond: ((product_id = 80) AND (location_dest_id = 397))
  • Filter: (date > '2019-01-24 14:47:40'::timestamp without time zone)
  • Rows Removed by Filter: 33
  • Heap Blocks: exact=36
14. 0.051 14.451 ↓ 0.0 0 1 / 3

BitmapAnd (cost=6,478.79..6,478.79 rows=1,539 width=0) (actual time=43.354..43.354 rows=0 loops=1)

15. 0.045 0.045 ↑ 230.3 1,337 1 / 3

Bitmap Index Scan on stock_pack_operation_product_id_fkey_mig_idx (cost=0.00..3,239.14 rows=307,877 width=0) (actual time=0.133..0.134 rows=1,337 loops=1)

  • Index Cond: (product_id = 80)
16. 14.356 14.356 ↓ 2.6 789,612 1 / 3

Bitmap Index Scan on stock_pack_operation_location_dest_id_fkey_mig_idx (cost=0.00..3,239.14 rows=307,877 width=0) (actual time=43.068..43.068 rows=789,612 loops=1)

  • Index Cond: (location_dest_id = 397)
17. 0.020 0.020 ↓ 0.0 0 12 / 3

Index Scan using stock_move_pkey on stock_move m_1 (cost=0.56..2.79 rows=1 width=4) (actual time=0.005..0.005 rows=0 loops=12)

  • Index Cond: (id = l_1.move_id)
  • Filter: ((inventory_id IS NULL) AND ((state)::text = 'done'::text))
  • Rows Removed by Filter: 1
Planning time : 1.036 ms
Execution time : 264.889 ms