explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1HXN

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

Aggregate (cost=301,683.34..301,683.35 rows=1 width=32) (actual time=42.792..42.792 rows=1 loops=1)

2. 26.326 42.870 ↑ 1.0 2 1

Gather (cost=10,622.11..301,683.33 rows=2 width=32) (actual time=42.784..42.870 rows=2 loops=1)

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

Parallel Append (cost=9,622.11..300,683.13 rows=1 width=32) (actual time=16.544..16.544 rows=1 loops=3)

4. 0.004 2.505 ↑ 1.0 1 1 / 3

Aggregate (cost=300,683.11..300,683.12 rows=1 width=32) (actual time=7.514..7.514 rows=1 loops=1)

5. 0.006 2.501 ↓ 17.0 17 1 / 3

Nested Loop (cost=3,239.85..300,683.10 rows=1 width=32) (actual time=6.533..7.503 rows=17 loops=1)

6. 2.303 2.382 ↑ 30.2 17 1 / 3

Bitmap Heap Scan on stock_move_line l (cost=3,239.29..299,254.39 rows=513 width=36) (actual time=6.475..7.146 rows=17 loops=1)

  • Recheck Cond: (product_id = 80)
  • Filter: ((date > '2019-01-24 14:47:40'::timestamp without time zone) AND (location_id = 397))
  • Rows Removed by Filter: 1,299
7. 0.079 0.079 ↑ 230.3 1,337 1 / 3

Bitmap Index Scan on stock_pack_operation_product_id_fkey_mig_idx (cost=0.00..3,239.16 rows=307,879 width=0) (actual time=0.237..0.237 rows=1,337 loops=1)

  • Index Cond: (product_id = 80)
8. 0.113 0.113 ↑ 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.020..0.020 rows=1 loops=17)

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

Aggregate (cost=9,622.11..9,622.12 rows=1 width=32) (actual time=42.113..42.114 rows=1 loops=1)

10. 0.004 14.035 ↓ 2.0 2 1 / 3

Nested Loop (cost=6,479.39..9,622.10 rows=1 width=32) (actual time=42.103..42.106 rows=2 loops=1)

11. 0.020 14.016 ↑ 42.8 12 1 / 3

Bitmap Heap Scan on stock_move_line l_1 (cost=6,478.82..8,193.39 rows=513 width=36) (actual time=42.008..42.047 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
12. 0.044 13.996 ↓ 0.0 0 1 / 3

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

13. 0.070 0.070 ↑ 230.3 1,337 1 / 3

Bitmap Index Scan on stock_pack_operation_product_id_fkey_mig_idx (cost=0.00..3,239.16 rows=307,879 width=0) (actual time=0.211..0.211 rows=1,337 loops=1)

  • Index Cond: (product_id = 80)
14. 13.882 13.882 ↓ 2.6 789,614 1 / 3

Bitmap Index Scan on stock_pack_operation_location_dest_id_fkey_mig_idx (cost=0.00..3,239.16 rows=307,879 width=0) (actual time=41.646..41.646 rows=789,614 loops=1)

  • Index Cond: (location_dest_id = 397)
15. 0.016 0.016 ↓ 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.004..0.004 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 : 0.840 ms
Execution time : 42.942 ms