explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 1pt

Settings
# exclusive inclusive rows x rows loops node
1. 0.012 5,851.762 ↑ 554.5 4 1

Sort (cost=684,645.96..684,651.50 rows=2,218 width=373) (actual time=5,851.761..5,851.762 rows=4 loops=1)

  • Output: f.idmun, f.producator, f.nume, f.prenume, f.dateplan, '2019_w45'::character varying(255), (sum(f.cantplan)), (sum(f.totalpiele)), f.yw
  • Sort Key: f.dateplan
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=1439711
2. 0.022 5,851.750 ↑ 554.5 4 1

GroupAggregate (cost=684,445.06..684,522.69 rows=2,218 width=373) (actual time=5,851.734..5,851.750 rows=4 loops=1)

  • Output: f.idmun, f.producator, f.nume, f.prenume, f.dateplan, '2019_w45'::character varying(255), sum(f.cantplan), sum(f.totalpiele), f.yw
  • Group Key: f.idmun, f.producator, f.nume, f.prenume, f.dateplan, f.yw
  • Buffers: shared hit=1439711
3. 0.036 5,851.728 ↑ 54.1 41 1

Sort (cost=684,445.06..684,450.60 rows=2,218 width=200) (actual time=5,851.726..5,851.728 rows=41 loops=1)

  • Output: f.idmun, f.producator, f.nume, f.prenume, f.dateplan, f.yw, f.cantplan, f.totalpiele
  • Sort Key: f.idmun, f.producator, f.nume, f.prenume, f.dateplan, f.yw
  • Sort Method: quicksort Memory: 30kB
  • Buffers: shared hit=1439711
4. 0.009 5,851.692 ↑ 54.1 41 1

Subquery Scan on f (cost=684,294.07..684,321.79 rows=2,218 width=200) (actual time=5,851.682..5,851.692 rows=41 loops=1)

  • Output: f.idmun, f.producator, f.nume, f.prenume, f.dateplan, f.yw, f.cantplan, f.totalpiele
  • Buffers: shared hit=1439711
5. 0.072 5,851.683 ↑ 54.1 41 1

Sort (cost=684,294.07..684,299.61 rows=2,218 width=457) (actual time=5,851.681..5,851.683 rows=41 loops=1)

  • Output: NULL::integer, NULL::integer, product_muncitori.idmun, NULL::integer, cinf.producator, product_muncitori.nume, product_muncitori.prenume, cip.dateplan, ((yweek(date(cip.dateplan)))::character varying(255)), NULL::numeric(2 (...)
  • Sort Key: (yweek(date(cip.dateplan))), cip.dateplan, product_muncitori.nume, product_muncitori.prenume
  • Sort Method: quicksort Memory: 30kB
  • Buffers: shared hit=1439711
6. 1.213 5,851.611 ↑ 54.1 41 1

Hash Join (cost=353,231.59..684,170.80 rows=2,218 width=457) (actual time=5,707.174..5,851.611 rows=41 loops=1)

  • Output: NULL::integer, NULL::integer, product_muncitori.idmun, NULL::integer, cinf.producator, product_muncitori.nume, product_muncitori.prenume, cip.dateplan, (yweek(date(cip.dateplan)))::character varying(255), NULL::numer (...)
  • Hash Cond: (comenzi_info.cmdid = cin.cmdid)
  • Buffers: shared hit=1439711
7. 0.227 2,679.808 ↑ 1.8 840 1

Group (cost=0.85..329,560.04 rows=1,525 width=4) (actual time=2,419.709..2,679.808 rows=840 loops=1)

  • Output: comenzi_info.cmdid
  • Group Key: comenzi_info.cmdid
  • Buffers: shared hit=1308514
8. 110.925 2,679.581 ↑ 1.8 840 1

Nested Loop (cost=0.85..329,556.23 rows=1,525 width=4) (actual time=2,419.707..2,679.581 rows=840 loops=1)

  • Output: comenzi_info.cmdid
  • Buffers: shared hit=1308514
9. 129.232 129.232 ↑ 1.0 304,928 1

Index Scan using idxcmdinf_cmdid on public.comenzi_info (cost=0.42..13,649.52 rows=304,977 width=8) (actual time=0.016..129.232 rows=304,928 loops=1)

  • Output: comenzi_info.idcmdinf, comenzi_info.cmdid, comenzi_info.cmdprocavans, comenzi_info.cmdscont, comenzi_info.cmdmoneda, comenzi_info.partrefnr, comenzi_info.producator, comenzi_info.info, comenzi_info. (...)
  • Buffers: shared hit=125794
10. 2,439.424 2,439.424 ↓ 0.0 0 304,928

Index Scan using pkcomenziout on public.comenzi_out (cost=0.43..1.03 rows=1 width=4) (actual time=0.008..0.008 rows=0 loops=304,928)

  • Output: comenzi_out.idcmdout, comenzi_out.cmdid, comenzi_out.artid, comenzi_out.refnr_client, comenzi_out.cmdoutculoare, comenzi_out.cmdoutdataliv, comenzi_out.cmdoutscont, comenzi_out.info, comenzi_out.can (...)
  • Index Cond: (comenzi_out.idcmdout = comenzi_info.client_idcmdout)
  • Filter: (((yweek(date(comenzi_out.cmdoutdataprod)))::character varying(255))::text = '2019_w45'::text)
  • Rows Removed by Filter: 1
  • Buffers: shared hit=1182720
11. 0.034 3,170.590 ↑ 108.2 41 1

Hash (cost=353,175.30..353,175.30 rows=4,435 width=127) (actual time=3,170.590..3,170.590 rows=41 loops=1)

  • Output: cin.cant, cin.cmdid, cinf.producator, cinf.cmdid, cip.dateplan, cip.cantplan, cip.cmdid, product_muncitori.idmun, product_muncitori.nume, product_muncitori.prenume, (sum(comenzi_out_2.cant)), (sum((comenzi_out_ (...)
  • Buckets: 8192 Batches: 1 Memory Usage: 69kB
  • Buffers: shared hit=131197
12. 85.360 3,170.556 ↑ 108.2 41 1

Merge Right Join (cost=302,936.01..353,175.30 rows=4,435 width=127) (actual time=2,755.277..3,170.556 rows=41 loops=1)

  • Output: cin.cant, cin.cmdid, cinf.producator, cinf.cmdid, cip.dateplan, cip.cantplan, cip.cmdid, product_muncitori.idmun, product_muncitori.nume, product_muncitori.prenume, (sum(comenzi_out_2.cant)), (sum((comenz (...)
  • Merge Cond: ((comenzi_out_1.artid = p.pieleartid) AND (comenzi_info_1.client_idcmdout = cout.idcmdout))
  • Buffers: shared hit=131197
13. 694.077 2,968.046 ↓ 1.1 1,335,963 1

GroupAggregate (cost=267,999.46..299,350.51 rows=1,254,042 width=40) (actual time=1,984.358..2,968.046 rows=1,335,963 loops=1)

  • Output: comenzi_out_1.artid, comenzi_info_1.client_idcmdout, sum((comenzi_out_1.cant + comenzi_out_1.cantfail))
  • Group Key: comenzi_out_1.artid, comenzi_info_1.client_idcmdout
  • Buffers: shared hit=91342
14. 1,182.791 2,273.969 ↓ 1.1 1,345,096 1

Sort (cost=267,999.46..271,134.56 rows=1,254,042 width=16) (actual time=1,984.337..2,273.969 rows=1,345,096 loops=1)

  • Output: comenzi_out_1.artid, comenzi_info_1.client_idcmdout, comenzi_out_1.cant, comenzi_out_1.cantfail
  • Sort Key: comenzi_out_1.artid, comenzi_info_1.client_idcmdout
  • Sort Method: quicksort Memory: 113043kB
  • Buffers: shared hit=91342
15. 527.267 1,091.178 ↓ 1.1 1,350,615 1

Hash Join (cost=30,706.41..140,976.57 rows=1,254,042 width=16) (actual time=381.077..1,091.178 rows=1,350,615 loops=1)

  • Output: comenzi_out_1.artid, comenzi_info_1.client_idcmdout, comenzi_out_1.cant, comenzi_out_1.cantfail
  • Hash Cond: (comenzi_out_1.cmdid = comenzi.idcmd)
  • Buffers: shared hit=91342
16. 183.451 183.451 ↓ 1.0 1,453,847 1

Seq Scan on public.comenzi_out comenzi_out_1 (cost=0.00..92,332.54 rows=1,439,254 width=16) (actual time=0.007..183.451 rows=1,453,847 loops=1)

  • Output: comenzi_out_1.idcmdout, comenzi_out_1.cmdid, comenzi_out_1.artid, comenzi_out_1.refnr_client, comenzi_out_1.cmdoutculoare, comenzi_out_1.cmdoutdataliv, comenzi_out_1.cmdoutscont, c (...)
  • Buffers: shared hit=77940
17. 56.075 380.460 ↑ 1.0 265,455 1

Hash (cost=27,385.24..27,385.24 rows=265,694 width=12) (actual time=380.460..380.460 rows=265,455 loops=1)

  • Output: comenzi.idcmd, comenzi_info_1.client_idcmdout, comenzi_info_1.cmdid
  • Buckets: 524288 Batches: 1 Memory Usage: 15503kB
  • Buffers: shared hit=13402
18. 151.262 324.385 ↑ 1.0 265,455 1

Hash Join (cost=12,396.86..27,385.24 rows=265,694 width=12) (actual time=131.483..324.385 rows=265,455 loops=1)

  • Output: comenzi.idcmd, comenzi_info_1.client_idcmdout, comenzi_info_1.cmdid
  • Hash Cond: (comenzi_info_1.cmdid = comenzi.idcmd)
  • Buffers: shared hit=13402
19. 42.275 42.275 ↑ 1.0 304,928 1

Seq Scan on public.comenzi_info comenzi_info_1 (cost=0.00..11,187.77 rows=304,977 width=8) (actual time=0.012..42.275 rows=304,928 loops=1)

  • Output: comenzi_info_1.idcmdinf, comenzi_info_1.cmdid, comenzi_info_1.cmdprocavans, comenzi_info_1.cmdscont, comenzi_info_1.cmdmoneda, comenzi_info_1.partrefnr, comenzi_info_1. (...)
  • Buffers: shared hit=8138
20. 45.383 130.848 ↑ 1.0 265,459 1

Hash (cost=9,075.69..9,075.69 rows=265,694 width=4) (actual time=130.848..130.848 rows=265,459 loops=1)

  • Output: comenzi.idcmd
  • Buckets: 524288 Batches: 1 Memory Usage: 13429kB
  • Buffers: shared hit=5264
21. 85.465 85.465 ↑ 1.0 265,459 1

Seq Scan on public.comenzi (cost=0.00..9,075.69 rows=265,694 width=4) (actual time=0.014..85.465 rows=265,459 loops=1)

  • Output: comenzi.idcmd
  • Filter: (comenzi.cmdtip = 3)
  • Rows Removed by Filter: 39464
  • Buffers: shared hit=5264
22. 0.070 117.150 ↑ 8.9 41 1

Sort (cost=34,936.55..34,937.46 rows=365 width=103) (actual time=117.134..117.150 rows=41 loops=1)

  • Output: cin.cant, cin.cmdid, cinf.producator, cinf.cmdid, cout.idcmdout, cip.dateplan, cip.cantplan, cip.cmdid, product_muncitori.idmun, product_muncitori.nume, product_muncitori.prenume, p.pieleartid, (sum (...)
  • Sort Key: p.pieleartid, cout.idcmdout
  • Sort Method: quicksort Memory: 30kB
  • Buffers: shared hit=39855
23. 4.565 117.080 ↑ 8.9 41 1

Hash Right Join (cost=34,547.01..34,921.02 rows=365 width=103) (actual time=98.347..117.080 rows=41 loops=1)

  • Output: cin.cant, cin.cmdid, cinf.producator, cinf.cmdid, cout.idcmdout, cip.dateplan, cip.cantplan, cip.cmdid, product_muncitori.idmun, product_muncitori.nume, product_muncitori.prenume, p.pieleartid (...)
  • Hash Cond: (comenzi_out_2.cmdid = cin.cmdid)
  • Buffers: shared hit=39855
24. 47.259 109.674 ↓ 4.2 59,919 1

HashAggregate (cost=32,357.09..32,535.07 rows=14,238 width=36) (actual time=93.943..109.674 rows=59,919 loops=1)

  • Output: comenzi_out_2.cmdid, sum(comenzi_out_2.cant)
  • Group Key: comenzi_out_2.cmdid
  • Buffers: shared hit=36490
25. 9.475 62.415 ↓ 4.2 60,119 1

Nested Loop (cost=0.43..32,285.90 rows=14,238 width=9) (actual time=0.050..62.415 rows=60,119 loops=1)

  • Output: comenzi_out_2.cmdid, comenzi_out_2.cant
  • Buffers: shared hit=36490
26. 5.260 5.260 ↓ 1.0 149 1

Seq Scan on public.articole (cost=0.00..2,013.47 rows=146 width=4) (actual time=0.038..5.260 rows=149 loops=1)

  • Output: articole.idart, articole.categorie, articole.grupa, articole.subgrupa, articole.brand, articole.denumire, articole.cod, articole.um, articole.pretalista, articole.adaoslista, (...)
  • Filter: ((articole.denumire)::text ~~ 'piele%'::text)
  • Rows Removed by Filter: 14665
  • Buffers: shared hit=1829
27. 47.680 47.680 ↓ 1.5 403 149

Index Scan using idxcmdout_cmdartid on public.comenzi_out comenzi_out_2 (cost=0.43..204.66 rows=269 width=13) (actual time=0.004..0.320 rows=403 loops=149)

  • Output: comenzi_out_2.idcmdout, comenzi_out_2.cmdid, comenzi_out_2.artid, comenzi_out_2.refnr_client, comenzi_out_2.cmdoutculoare, comenzi_out_2.cmdoutdataliv, comenzi_out_2.cmdoutsc (...)
  • Index Cond: (comenzi_out_2.artid = articole.idart)
  • Buffers: shared hit=34661
28. 0.032 2.841 ↑ 8.9 41 1

Hash (cost=2,185.35..2,185.35 rows=365 width=71) (actual time=2.840..2.841 rows=41 loops=1)

  • Output: cin.cant, cin.cmdid, cinf.producator, cinf.cmdid, cout.idcmdout, cip.dateplan, cip.cantplan, cip.cmdid, product_muncitori.idmun, product_muncitori.nume, product_muncitori.prenume, p.piel (...)
  • Buckets: 1024 Batches: 1 Memory Usage: 13kB
  • Buffers: shared hit=3365
29. 0.038 2.809 ↑ 8.9 41 1

Nested Loop (cost=42.47..2,185.35 rows=365 width=71) (actual time=1.557..2.809 rows=41 loops=1)

  • Output: cin.cant, cin.cmdid, cinf.producator, cinf.cmdid, cout.idcmdout, cip.dateplan, cip.cantplan, cip.cmdid, product_muncitori.idmun, product_muncitori.nume, product_muncitori.prenume, (...)
  • Join Filter: (cinf.cmdid = cin.cmdid)
  • Buffers: shared hit=3365
30. 0.046 2.648 ↑ 4.3 41 1

Hash Left Join (cost=42.05..2,087.24 rows=175 width=63) (actual time=1.542..2.648 rows=41 loops=1)

  • Output: cinf.producator, cinf.cmdid, cout.idcmdout, cip.dateplan, cip.cantplan, cip.cmdid, product_muncitori.idmun, product_muncitori.nume, product_muncitori.prenume, p.pieleartid
  • Hash Cond: ((cout.cmdoutculoare)::text = (p.culoarecod)::text)
  • Buffers: shared hit=3201
31. 0.018 1.626 ↑ 4.3 41 1

Hash Join (cost=2.45..2,046.60 rows=175 width=60) (actual time=0.555..1.626 rows=41 loops=1)

  • Output: cinf.producator, cinf.cmdid, cout.idcmdout, cout.cmdoutculoare, cip.dateplan, cip.cantplan, cip.cmdid, product_muncitori.idmun, product_muncitori.nume, product_muncitor (...)
  • Hash Cond: (cip.munid = product_muncitori.idmun)
  • Buffers: shared hit=2486
32. 0.000 1.591 ↑ 4.3 41 1

Nested Loop (cost=0.84..2,042.58 rows=175 width=46) (actual time=0.531..1.591 rows=41 loops=1)

  • Output: cinf.producator, cinf.cmdid, cout.idcmdout, cout.cmdoutculoare, cip.dateplan, cip.cantplan, cip.cmdid, cip.munid
  • Buffers: shared hit=2485
33. 0.269 1.383 ↑ 3.4 109 1

Nested Loop (cost=0.42..1,864.89 rows=376 width=26) (actual time=0.517..1.383 rows=109 loops=1)

  • Output: cinf.producator, cinf.cmdid, cout.idcmdout, cout.cmdoutculoare
  • Buffers: shared hit=2116
34. 0.082 0.082 ↑ 1.0 516 1

Seq Scan on public.usrpostgresplanif0 cout (cost=0.00..24.16 rows=516 width=5) (actual time=0.012..0.082 rows=516 loops=1)

  • Output: cout.idcmdout, cout.cmdid, cout.artid, cout.refnr_client, cout.cmdoutculoare, cout.cmdoutdataliv, cout.cmdoutscont, cout.info, cout.cant, cout.cantfai (...)
  • Buffers: shared hit=19
35. 1.032 1.032 ↓ 0.0 0 516

Index Scan using idxcmdinf_client_idcmdout on public.comenzi_info cinf (cost=0.42..3.56 rows=1 width=25) (actual time=0.002..0.002 rows=0 loops=516)

  • Output: cinf.idcmdinf, cinf.cmdid, cinf.cmdprocavans, cinf.cmdscont, cinf.cmdmoneda, cinf.partrefnr, cinf.producator, cinf.info, cinf.datain, cinf.gestin, cin (...)
  • Index Cond: (cinf.client_idcmdout = cout.idcmdout)
  • Filter: (((cinf.producator)::text !~~ '%cuie'::text) AND (cinf.fazaid = 1))
  • Rows Removed by Filter: 1
  • Buffers: shared hit=2097
36. 0.218 0.218 ↓ 0.0 0 109

Index Scan using idxcomenzi_in_pers_cmdid on public.comenzi_in_pers cip (cost=0.42..0.46 rows=1 width=20) (actual time=0.002..0.002 rows=0 loops=109)

  • Output: cip.idcip, cip.cmdid, cip.munid, cip.dateplan, cip.cantplan, cip.cantrez
  • Index Cond: (cip.cmdid = cinf.cmdid)
  • Buffers: shared hit=369
37. 0.006 0.017 ↑ 1.0 27 1

Hash (cost=1.27..1.27 rows=27 width=18) (actual time=0.017..0.017 rows=27 loops=1)

  • Output: product_muncitori.idmun, product_muncitori.nume, product_muncitori.prenume
  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
  • Buffers: shared hit=1
38. 0.011 0.011 ↑ 1.0 27 1

Seq Scan on public.product_muncitori (cost=0.00..1.27 rows=27 width=18) (actual time=0.006..0.011 rows=27 loops=1)

  • Output: product_muncitori.idmun, product_muncitori.nume, product_muncitori.prenume
  • Buffers: shared hit=1
39. 0.027 0.976 ↓ 21.8 218 1

Hash (cost=39.47..39.47 rows=10 width=8) (actual time=0.976..0.976 rows=218 loops=1)

  • Output: p.culoarecod, p.pieleartid
  • Buckets: 1024 Batches: 1 Memory Usage: 17kB
  • Buffers: shared hit=715
40. 0.027 0.949 ↓ 21.8 218 1

Subquery Scan on p (cost=39.30..39.47 rows=10 width=8) (actual time=0.875..0.949 rows=218 loops=1)

  • Output: p.culoarecod, p.pieleartid
  • Buffers: shared hit=715
41. 0.037 0.922 ↓ 21.8 218 1

Group (cost=39.30..39.37 rows=10 width=39) (actual time=0.873..0.922 rows=218 loops=1)

  • Output: pgc.culoarecod, a.denumire, a.idart
  • Group Key: pgc.culoarecod, a.idart
  • Buffers: shared hit=715
42. 0.285 0.885 ↓ 21.8 218 1

Sort (cost=39.30..39.32 rows=10 width=39) (actual time=0.871..0.885 rows=218 loops=1)

  • Output: pgc.culoarecod, a.idart, a.denumire
  • Sort Key: pgc.culoarecod, a.idart
  • Sort Method: quicksort Memory: 42kB
  • Buffers: shared hit=715
43. 0.000 0.600 ↓ 21.8 218 1

Nested Loop (cost=0.56..39.13 rows=10 width=39) (actual time=0.034..0.600 rows=218 loops=1)

  • Output: pgc.culoarecod, a.idart, a.denumire
  • Buffers: shared hit=715
44. 0.113 0.170 ↓ 21.8 218 1

Nested Loop (cost=0.28..27.69 rows=10 width=8) (actual time=0.022..0.170 rows=218 loops=1)

  • Output: pgc.culoarecod, pgc.artid
  • Buffers: shared hit=60
  • -> Index Scan using idxproduct_genericart_artgenid on public.product_genericart_colorarts pgc (cost=0.28..3.72 rows=3 width=12) (actual time=0.0 (...)
45. 0.057 0.057 ↑ 1.0 4 1

Seq Scan on public.product_genericart pg (cost=0.00..12.68 rows=4 width=4) (actual time=0.008..0.057 rows=4 loops=1)

  • Output: pg.idartgen, pg.denumire, pg.info, pg.tip, pg.denumire_eng
  • Filter: (pg.tip = 0)
  • Rows Removed by Filter: 551
  • Buffers: shared hit=5
  • Output: pgc.idcolarts, pgc.artgenid, pgc.artid, pgc.culoarecod, pgc.ignifug, pgc.sewingcod, pgc.genambalaj_imbunatatit
  • Index Cond: (pgc.artgenid = pg.idartgen)
  • Buffers: shared hit=55
46. 0.436 0.436 ↑ 1.0 1 218

Index Scan using idxart_idart on public.articole a (cost=0.29..1.13 rows=1 width=35) (actual time=0.002..0.002 rows=1 loops=218)

  • Output: a.idart, a.categorie, a.grupa, a.subgrupa, a.brand, a.denumire, a.cod, a.um, a.pretalista, a.adaoslista, a.pretlista, a.monedalista, a.ada (...)
  • Index Cond: (a.idart = pgc.artid)
  • Buffers: shared hit=655
47. 0.123 0.123 ↑ 2.0 1 41

Index Scan using idxcmdin_cmdid on public.comenzi_in cin (cost=0.42..0.54 rows=2 width=8) (actual time=0.003..0.003 rows=1 loops=41)

  • Output: cin.idcmdin, cin.cmdid, cin.artid, cin.cmdindataliv, cin.cmdoutid, cin.info, cin.cant, cin.cantfail, cin.pretc, cin.monedac, cin.userid, cin.datemodified, cin.cmdsellcod, cin (...)
  • Index Cond: (cin.cmdid = cip.cmdid)
  • Buffers: shared hit=164
Planning time : 9.954 ms
Execution time : 5,862.007 ms