explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HJqv

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 4,762.518 ↑ 1.0 25 1

Limit (cost=261,187.54..261,254.36 rows=25 width=157) (actual time=4,762.396..4,762.518 rows=25 loops=1)

2. 0.045 4,762.512 ↑ 3,990.1 25 1

GroupAggregate (cost=261,187.54..527,777.52 rows=99,753 width=157) (actual time=4,762.394..4,762.512 rows=25 loops=1)

  • Group Key: st.package_gtin, st.package_pharmacode, st.name_default, st.dosage_id, st.supplier_name, st.package_size, st.production_date, st.planned_production_date
3. 4,320.620 4,762.392 ↑ 38,366.7 26 1

Sort (cost=261,187.54..263,681.38 rows=997,533 width=103) (actual time=4,762.366..4,762.392 rows=26 loops=1)

  • Sort Key: st.package_gtin, st.package_pharmacode, st.name_default, st.dosage_id, st.supplier_name, st.package_size, st.production_date, st.planned_production_date
  • Sort Method: external merge Disk: 114,504kB
4. 441.772 441.772 ↑ 1.0 996,455 1

Seq Scan on stock_need st (cost=0.00..52,684.33 rows=997,533 width=103) (actual time=0.008..441.772 rows=996,455 loops=1)

5.          

SubPlan (for GroupAggregate)

6. 0.000 0.075 ↑ 1.0 1 25

Aggregate (cost=2.38..2.38 rows=1 width=32) (actual time=0.003..0.003 rows=1 loops=25)

7. 0.025 0.075 ↓ 0.0 0 25

Nested Loop (cost=0.00..2.37 rows=1 width=32) (actual time=0.003..0.003 rows=0 loops=25)

  • Join Filter: (sl.location_settings_id = ls.id)
8. 0.050 0.050 ↓ 0.0 0 25

Seq Scan on stock_location sl (cost=0.00..1.12 rows=1 width=64) (actual time=0.002..0.002 rows=0 loops=25)

  • Filter: ((gtin)::text = (st.package_gtin)::text)
  • Rows Removed by Filter: 16
9. 0.000 0.000 ↓ 0.0 0

Seq Scan on stock_location_settings ls (cost=0.00..1.20 rows=4 width=32) (never executed)

  • Filter: ((aggregation_type)::text = ANY ('{PACKAGE,DOSE,CANISTER,PRODUCTION}'::text[]))
Planning time : 0.310 ms