explain.depesz.com

PostgreSQL's explain analyze made readable

Result: AyQ7

Settings
# exclusive inclusive rows x rows loops node
1. 0.001 2,607.823 ↑ 1.0 1 1

Limit (cost=149,206.63..149,206.64 rows=1 width=8) (actual time=2,607.823..2,607.823 rows=1 loops=1)

2. 2.733 2,607.822 ↑ 1.0 1 1

Aggregate (cost=149,206.63..149,206.64 rows=1 width=8) (actual time=2,607.822..2,607.822 rows=1 loops=1)

3. 33.329 2,605.089 ↓ 53.4 26,596 1

Subquery Scan on stockcover0_ (cost=107,892.23..149,205.39 rows=498 width=0) (actual time=1,365.940..2,605.089 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. 170.862 2,571.760 ↓ 3.3 324,595 1

Finalize GroupAggregate (cost=107,892.23..146,216.01 rows=99,646 width=293) (actual time=1,365.923..2,571.760 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. 417.451 2,400.898 ↓ 2.1 414,193 1

Gather Merge (cost=107,892.23..141,233.71 rows=199,292 width=93) (actual time=1,365.917..2,400.898 rows=414,193 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
6. 134.866 1,983.447 ↓ 1.4 138,064 3 / 3

Partial GroupAggregate (cost=106,892.21..117,230.44 rows=99,646 width=93) (actual time=1,339.383..1,983.447 rows=138,064 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. 1,676.544 1,848.581 ↑ 1.2 332,152 3 / 3

Sort (cost=106,892.21..107,930.18 rows=415,190 width=93) (actual time=1,339.373..1,848.581 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,848kB
8. 172.037 172.037 ↑ 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.068..172.037 rows=332,152 loops=3)

Planning time : 0.406 ms