explain.depesz.com

PostgreSQL's explain analyze made readable

Result: r7ra

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 2,055.437 ↑ 1.0 1 1

Limit (cost=146,252.93..146,252.94 rows=1 width=8) (actual time=2,055.437..2,055.437 rows=1 loops=1)

2. 2.493 2,055.435 ↑ 1.0 1 1

Aggregate (cost=146,252.93..146,252.94 rows=1 width=8) (actual time=2,055.435..2,055.435 rows=1 loops=1)

3. 20.165 2,052.942 ↓ 52.4 26,107 1

Subquery Scan on stockcover0_ (cost=106,474.73..146,251.68 rows=498 width=0) (actual time=1,136.153..2,052.942 rows=26,107 loops=1)

  • Filter: ((stockcover0_.planned_production_date >= '2020-09-01'::date) AND (stockcover0_.planned_production_date < '2020-10-01'::date) AND (lower((stockcover0_.name_default)::text) ~~ '%'::text) AND (lower((stockcover0_.supplier_name)::text) ~~ '%'::text) AND (lower((stockcover0_.package_gtin)::text) ~~ '%'::text))
  • Rows Removed by Filter: 87,479
4. 82.112 2,032.777 ↓ 1.1 113,586 1

Finalize GroupAggregate (cost=106,474.73..143,262.30 rows=99,646 width=285) (actual time=1,136.136..2,032.777 rows=113,586 loops=1)

  • Group Key: st.package_gtin, st.package_pharmacode, st.name_default, st.dosage_id, st.supplier_name, st.package_size, st.planned_production_date
5. 208.724 1,950.665 ↓ 1.1 217,517 1

Gather Merge (cost=106,474.73..138,778.23 rows=199,292 width=85) (actual time=1,136.128..1,950.665 rows=217,517 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
6. 126.351 1,741.941 ↑ 1.4 72,506 3 / 3

Partial GroupAggregate (cost=105,474.71..114,774.97 rows=99,646 width=85) (actual time=1,130.021..1,741.941 rows=72,506 loops=3)

  • Group Key: st.package_gtin, st.package_pharmacode, st.name_default, st.dosage_id, st.supplier_name, st.package_size, st.planned_production_date
7. 1,439.978 1,615.590 ↑ 1.2 332,152 3 / 3

Sort (cost=105,474.71..106,512.68 rows=415,190 width=85) (actual time=1,130.012..1,615.590 rows=332,152 loops=3)

  • Sort Key: st.package_gtin, st.package_pharmacode, st.name_default, st.dosage_id, st.supplier_name, st.package_size, st.planned_production_date
  • Sort Method: external merge Disk: 32,568kB
8. 175.612 175.612 ↑ 1.2 332,152 3 / 3

Parallel Seq Scan on stock_need st (cost=0.00..46,860.90 rows=415,190 width=85) (actual time=0.108..175.612 rows=332,152 loops=3)

Planning time : 0.381 ms