explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ZYPF

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 3,249.465 ↑ 1.0 1 1

Limit (cost=149,206.63..149,206.64 rows=1 width=8) (actual time=3,249.464..3,249.465 rows=1 loops=1)

2. 3.160 3,249.464 ↑ 1.0 1 1

Aggregate (cost=149,206.63..149,206.64 rows=1 width=8) (actual time=3,249.463..3,249.464 rows=1 loops=1)

3. 41.534 3,246.304 ↓ 53.4 26,596 1

Subquery Scan on stockcover0_ (cost=107,892.23..149,205.39 rows=498 width=0) (actual time=1,735.619..3,246.304 rows=26,596 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: 297,999
4. 204.967 3,204.770 ↓ 3.3 324,595 1

Finalize GroupAggregate (cost=107,892.23..146,216.01 rows=99,646 width=293) (actual time=1,735.602..3,204.770 rows=324,595 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
5. 490.568 2,999.803 ↓ 2.0 397,311 1

Gather Merge (cost=107,892.23..141,233.71 rows=199,292 width=93) (actual time=1,735.597..2,999.803 rows=397,311 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
6. 170.969 2,509.235 ↓ 1.3 132,437 3 / 3

Partial GroupAggregate (cost=106,892.21..117,230.44 rows=99,646 width=93) (actual time=1,704.665..2,509.235 rows=132,437 loops=3)

  • 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
7. 2,130.963 2,338.266 ↑ 1.2 332,152 3 / 3

Sort (cost=106,892.21..107,930.18 rows=415,190 width=93) (actual time=1,704.656..2,338.266 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.production_date, st.planned_production_date
  • Sort Method: external merge Disk: 34,864kB
8. 207.303 207.303 ↑ 1.2 332,152 3 / 3

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

Planning time : 0.313 ms