explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qSmy

Settings
# exclusive inclusive rows x rows loops node
1. 0.023 9,712.226 ↑ 1.0 1 1

Sort (cost=833,165.87..833,165.88 rows=1 width=413) (actual time=9,712.226..9,712.226 rows=1 loops=1)

  • Output: product_faze.faza, cmd_in_docs_rest_woodothers_selweek.idcmdin, (false), product_faze.fgestsourcewoodothers, mygestiunis.gestiune, product_faze.fgestlanswoodothers, mygestiunid.gestiune, cmd_in_docs_rest_woodothers_selweek.artid, cmd_in_docs_rest (...)
  • Sort Key: cmd_in_docs_rest_woodothers_selweek.cmdpart, cmd_in_docs_rest_woodothers_selweek.client_idcmdout, articole.denumire
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=2287875, temp read=8434 written=8434
2. 0.035 9,712.203 ↑ 1.0 1 1

Nested Loop (cost=833,163.64..833,165.86 rows=1 width=413) (actual time=9,712.202..9,712.203 rows=1 loops=1)

  • Output: product_faze.faza, cmd_in_docs_rest_woodothers_selweek.idcmdin, (false), product_faze.fgestsourcewoodothers, mygestiunis.gestiune, product_faze.fgestlanswoodothers, mygestiunid.gestiune, cmd_in_docs_rest_woodothers_selweek.artid, cmd_in_doc (...)
  • Join Filter: (cmd_in_docs_rest_woodothers_selweek.idcmd = comenzi_in_pers.cmdid)
  • Buffers: shared hit=2287875, temp read=8434 written=8434
3. 0.017 9,711.731 ↑ 1.0 1 1

Sort (cost=833,154.95..833,154.96 rows=1 width=305) (actual time=9,711.731..9,711.731 rows=1 loops=1)

  • Output: product_faze.faza, cmd_in_docs_rest_woodothers_selweek.idcmdin, false, product_faze.fgestsourcewoodothers, mygestiunis.gestiune, product_faze.fgestlanswoodothers, mygestiunid.gestiune, cmd_in_docs_rest_woodothers_selweek.artid, cmd_in (...)
  • Sort Key: articole.fazaart DESC, cmd_in_docs_rest_woodothers_selweek.client_idcmdout, articole.denumire, cmd_in_docs_rest_woodothers_selweek.idcmdin
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=2287859, temp read=8434 written=8434
4. 63.950 9,711.714 ↑ 1.0 1 1

Merge Right Join (cost=797,746.57..833,154.94 rows=1 width=305) (actual time=9,711.658..9,711.714 rows=1 loops=1)

  • Output: product_faze.faza, cmd_in_docs_rest_woodothers_selweek.idcmdin, false, product_faze.fgestsourcewoodothers, mygestiunis.gestiune, product_faze.fgestlanswoodothers, mygestiunid.gestiune, cmd_in_docs_rest_woodothers_selweek.artid, (...)
  • Merge Cond: ((c.comandaout = cmd_in_docs_rest_woodothers_selweek.idcmd) AND (c.artidout = cmd_in_docs_rest_woodothers_selweek.artid))
  • Buffers: shared hit=2287859, temp read=8434 written=8434
5. 510.945 9,645.364 ↓ 3.4 960,065 1

GroupAggregate (cost=791,112.42..822,255.11 rows=283,115 width=80) (actual time=8,630.498..9,645.364 rows=960,065 loops=1)

  • Output: c.comandaout, c.artidout, NULL::double precision, NULL::double precision, NULL::double precision, NULL::double precision, NULL::double precision, NULL::double precision, NULL::double precision, sum(c.transfer), NULL::doubl (...)
  • Group Key: c.comandaout, c.artidout
  • Buffers: shared hit=2287703, temp read=8434 written=8434
6. 2,127.387 9,134.419 ↑ 1.1 2,652,448 1

Sort (cost=791,112.42..798,190.30 rows=2,831,154 width=16) (actual time=8,630.382..9,134.419 rows=2,652,448 loops=1)

  • Output: c.comandaout, c.artidout, c.transfer
  • Sort Key: c.comandaout, c.artidout
  • Sort Method: external merge Disk: 67368kB
  • Buffers: shared hit=2287703, temp read=8434 written=8434
7. 297.518 7,007.032 ↑ 1.1 2,652,448 1

Subquery Scan on c (cost=2.95..460,064.38 rows=2,831,154 width=16) (actual time=0.045..7,007.032 rows=2,652,448 loops=1)

  • Output: c.comandaout, c.artidout, c.transfer
  • Buffers: shared hit=2287703
8. 4,550.411 6,709.514 ↑ 1.1 2,652,448 1

Merge Join (cost=2.95..431,752.84 rows=2,831,154 width=469) (actual time=0.043..6,709.514 rows=2,652,448 loops=1)

  • Output: docout.comandaout, docin.artid, NULL::timestamp without time zone, NULL::character varying(50), NULL::character varying(250), NULL::character varying(250), NULL::integer, NULL::numeric(26,10), NULL::numer (...)
  • Merge Cond: (docin.lot = docout.lotout)
  • Join Filter: (CASE (docout.comandaout = 0) WHEN CASE_TEST_EXPR THEN docin.comandain ELSE docout.comandaout END <> 0)
  • Rows Removed by Join Filter: 192933
  • Buffers: shared hit=2287703
9. 700.430 700.430 ↑ 1.0 1,728,259 1

Index Scan using idxdocinlot on public.docin (cost=0.43..107,580.85 rows=1,728,295 width=12) (actual time=0.013..700.430 rows=1,728,259 loops=1)

  • Output: docin.lot, docin.artid, docin.comandain, docin.gestid, docin.valid, docin.partener, docin.datdoc, docin.tipdoc, docin.nrdoc, docin.nrdocsec, docin.cantrec, docin.cantdoc, docin.cotatva, docin.preta, (...)
  • Buffers: shared hit=454761
10. 1,458.673 1,458.673 ↑ 1.0 2,845,381 1

Index Scan using idxdocoutlotout on public.docout (cost=0.43..128,505.14 rows=2,845,381 width=23) (actual time=0.008..1,458.673 rows=2,845,381 loops=1)

  • Output: docout.idout, docout.lotout, docout.comandaout, docout.valid, docout.partener, docout.datdoc, docout.tipdoc, docout.nrdoc, docout.nrdocsec, docout.cantout, docout.pret, docout.pretdef, docout.moneda (...)
  • Buffers: shared hit=1832942
11. 0.017 2.400 ↑ 1.0 1 1

Materialize (cost=6,634.15..6,653.05 rows=1 width=296) (actual time=2.347..2.400 rows=1 loops=1)

  • Output: cmd_in_docs_rest_woodothers_selweek.idcmdin, cmd_in_docs_rest_woodothers_selweek.artid, cmd_in_docs_rest_woodothers_selweek.cmdnr, cmd_in_docs_rest_woodothers_selweek.client_idcmdout, cmd_in_docs_rest_woodothers_selweek.id (...)
  • Buffers: shared hit=156
12. 0.010 2.383 ↑ 1.0 1 1

Merge Left Join (cost=6,634.15..6,653.05 rows=1 width=296) (actual time=2.331..2.383 rows=1 loops=1)

  • Output: cmd_in_docs_rest_woodothers_selweek.idcmdin, cmd_in_docs_rest_woodothers_selweek.artid, cmd_in_docs_rest_woodothers_selweek.cmdnr, cmd_in_docs_rest_woodothers_selweek.client_idcmdout, cmd_in_docs_rest_woodothers_selw (...)
  • Merge Cond: ((cmd_in_docs_rest_woodothers_selweek.idcmd = cl0_1.cmdid) AND (cmd_in_docs_rest_woodothers_selweek.artid = cl0_1.artid))
  • Buffers: shared hit=156
13. 0.010 2.062 ↑ 1.0 1 1

Merge Join (cost=93.02..111.64 rows=1 width=288) (actual time=2.012..2.062 rows=1 loops=1)

  • Output: cmd_in_docs_rest_woodothers_selweek.idcmdin, cmd_in_docs_rest_woodothers_selweek.artid, cmd_in_docs_rest_woodothers_selweek.cmdnr, cmd_in_docs_rest_woodothers_selweek.client_idcmdout, cmd_in_docs_rest_woodother (...)
  • Merge Cond: ((cl0.cmdid = cmd_in_docs_rest_woodothers_selweek.idcmd) AND (cl0.artid = cmd_in_docs_rest_woodothers_selweek.artid))
  • Buffers: shared hit=125
14. 0.009 0.904 ↑ 6.0 1 1

GroupAggregate (cost=49.59..49.72 rows=6 width=16) (actual time=0.904..0.904 rows=1 loops=1)

  • Output: cl0.cmdid, cl0.artid, max(cl0.cantlansat)
  • Group Key: cl0.cmdid, cl0.artid
  • Filter: (max(cl0.cantlansat) IS NOT NULL)
  • Buffers: shared hit=49
15. 0.026 0.895 ↑ 3.0 2 1

Sort (cost=49.59..49.60 rows=6 width=16) (actual time=0.895..0.895 rows=2 loops=1)

  • Output: cl0.cmdid, cl0.artid, cl0.cantlansat
  • Sort Key: cl0.cmdid, cl0.artid
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=49
16. 0.002 0.869 ↑ 3.0 2 1

Subquery Scan on cl0 (cost=40.49..49.51 rows=6 width=16) (actual time=0.842..0.869 rows=2 loops=1)

  • Output: cl0.cmdid, cl0.artid, cl0.cantlansat
  • Buffers: shared hit=49
17. 0.056 0.867 ↑ 3.0 2 1

Nested Loop (cost=40.49..49.45 rows=6 width=72) (actual time=0.841..0.867 rows=2 loops=1)

  • Output: comenzi_in.cmdid, comenzi_in.artid, NULL::numeric(26,10), NULL::numeric(26,10), NULL::double precision, CASE ((comenzi_out_1.cant - comenzi_out_1.cantfail) = '0'::numeric) WHEN CASE_TEST (...)
  • Join Filter: (comenzi_info.cmdid = comenzi_in.cmdid)
  • Buffers: shared hit=49
18. 0.013 0.799 ↑ 2.0 2 1

Nested Loop Left Join (cost=40.07..47.37 rows=4 width=24) (actual time=0.778..0.799 rows=2 loops=1)

  • Output: comenzi_info.cmdid, comenzi_out_1.cant, comenzi_out_1.cantfail, comenzi_out_1.cmdid, (sum((CASE ((docout_1.tipdoc)::text ~~ 'lansliv%'::text) WHEN CASE_TEST_EXPR THEN (docout_1.can (...)
  • Buffers: shared hit=41
19. 0.028 0.540 ↑ 2.0 2 1

Nested Loop (cost=8.84..13.42 rows=4 width=20) (actual time=0.532..0.540 rows=2 loops=1)

  • Output: comenzi_info.cmdid, comenzi_out_1.cant, comenzi_out_1.cantfail, comenzi_out_1.cmdid, comenzi_out_1.artid
  • Buffers: shared hit=20
20. 0.013 0.482 ↑ 3.5 2 1

Nested Loop (cost=8.55..11.21 rows=7 width=20) (actual time=0.479..0.482 rows=2 loops=1)

  • Output: comenzi_info.cmdid, comenzi_out_1.cant, comenzi_out_1.cantfail, comenzi_out_1.cmdid, comenzi_out_1.artid
  • Buffers: shared hit=14
21. 0.003 0.455 ↑ 1.0 1 1

Group (cost=8.13..8.15 rows=1 width=4) (actual time=0.454..0.455 rows=1 loops=1)

  • Output: comenzi_info.cmdid
  • Group Key: comenzi_info.cmdid
  • Buffers: shared hit=10
22. 0.000 0.452 ↑ 1.0 1 1

Group (cost=8.13..8.14 rows=1 width=8) (actual time=0.452..0.452 rows=1 loops=1)

  • Output: comenzi_info.cmdid, comenzi_out_3.idcmdout
  • Group Key: comenzi_info.cmdid, comenzi_out_3.idcmdout
  • Buffers: shared hit=10
23.          

Initplan (forGroup)

24. 0.048 0.048 ↑ 1.0 1 1

Index Scan using idxallvarslowerusername on public.myvars myvars_3 (cost=0.15..2.17 rows=1 width=8) (actual time=0.048..0.048 rows=1 loops=1)

  • Output: myvars_3.ic_mask
  • Index Cond: (lower((myvars_3.username)::text) = lower((("current_user"())::text)::text))
  • Buffers: shared hit=2
25. 0.009 0.451 ↑ 1.0 1 1

Sort (cost=5.96..5.96 rows=1 width=8) (actual time=0.451..0.451 rows=1 loops=1)

  • Output: comenzi_info.cmdid, comenzi_out_3.idcmdout
  • Sort Key: comenzi_info.cmdid, comenzi_out_3.idcmdout
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=10
26. 0.418 0.442 ↑ 1.0 1 1

Nested Loop (cost=0.85..5.95 rows=1 width=8) (actual time=0.440..0.442 rows=1 loops=1)

  • Output: comenzi_info.cmdid, comenzi_out_3.idcmdout
  • Buffers: shared hit=10
  • -> Index Scan using idxcomenzi_outprod_type on public.comenzi_out comenzi_out_3 (cost=0.43..2.70 rows=1 width=4) (actual time=0.393..0.395 rows=1 loop (...)
  • Output: comenzi_out_3.idcmdout, comenzi_out_3.cmdid, comenzi_out_3.artid, comenzi_out_3.refnr_client, comenzi_out_3.cmdoutculoare, comenzi_out_3.c (...)
  • Index Cond: ((comenzi_out_3.prod_type)::text = 'woodothers'::text)
  • Filter: (yweek(date(comenzi_out_3.cmdoutdataprod)) = ($3)::text)
  • Rows Removed by Filter: 2
  • Buffers: shared hit=6
27. 0.024 0.024 ↑ 3.0 1 1

Index Scan using idxcmdinf_client_idcmdout on public.comenzi_info (cost=0.42..3.22 rows=3 width=8) (actual time=0.024..0.024 rows=1 loops=1)

  • Output: comenzi_info.idcmdinf, comenzi_info.cmdid, comenzi_info.cmdprocavans, comenzi_info.cmdscont, comenzi_info.cmdmoneda, comenzi_info.partrefn (...)
  • Index Cond: (comenzi_info.client_idcmdout = comenzi_out_3.idcmdout)
  • Buffers: shared hit=4
28. 0.014 0.014 ↑ 3.5 2 1

Index Scan using idxcmdout_cmdid on public.comenzi_out comenzi_out_1 (cost=0.43..2.98 rows=7 width=16) (actual time=0.013..0.014 rows=2 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_ou (...)
  • Index Cond: (comenzi_out_1.cmdid = comenzi_info.cmdid)
  • Filter: (comenzi_out_1.cant <> '0'::numeric)
  • Buffers: shared hit=4
29. 0.030 0.030 ↑ 1.0 1 2

Index Scan using idxart_idart on public.articole articole_1 (cost=0.29..0.31 rows=1 width=4) (actual time=0.015..0.015 rows=1 loops=2)

  • Output: articole_1.idart, articole_1.categorie, articole_1.grupa, articole_1.subgrupa, articole_1.brand, articole_1.denumire, articole_1.cod, articole_1.um, articole_1.pretalis (...)
  • Index Cond: (articole_1.idart = comenzi_out_1.artid)
  • Filter: (articole_1.art_type = ANY ('{1,2,5}'::integer[]))
  • Buffers: shared hit=6
30. 0.022 0.246 ↑ 1.0 1 2

Hash Right Join (cost=31.23..31.90 rows=1 width=16) (actual time=0.123..0.123 rows=1 loops=2)

  • Output: comenzi_out_2.artid, comenzi_out_2.cmdid, (sum((CASE ((docout_1.tipdoc)::text ~~ 'lansliv%'::text) WHEN CASE_TEST_EXPR THEN (docout_1.cantout)::double precision ELSE '0'::dou (...)
  • Hash Cond: ((docin_1.artid = comenzi_out_2.artid) AND (docout_1.comandaout = comenzi_out_2.cmdid))
  • Buffers: shared hit=21
31. 0.006 0.204 ↓ 0.0 0 2

HashAggregate (cost=30.61..30.85 rows=24 width=80) (actual time=0.102..0.102 rows=0 loops=2)

  • Output: docout_1.comandaout, docin_1.artid, NULL::double precision, NULL::double precision, sum((CASE ((docout_1.tipdoc)::text ~~ 'lansliv%'::text) WHEN CASE_TEST_EXPR THEN (do (...)
  • Group Key: docout_1.comandaout, docin_1.artid
  • Buffers: shared hit=13
32. 0.003 0.198 ↓ 0.0 0 1

Nested Loop (cost=8.98..30.19 rows=24 width=469) (actual time=0.198..0.198 rows=0 loops=1)

  • Output: docout_1.comandaout, docin_1.artid, NULL::timestamp without time zone, NULL::character varying(50), NULL::character varying(250), NULL::character varying(250), NU (...)
  • Buffers: shared hit=13
33. 0.013 0.195 ↓ 0.0 0 1

Nested Loop (cost=8.56..17.26 rows=24 width=23) (actual time=0.195..0.195 rows=0 loops=1)

  • Output: docout_1.comandaout, docout_1.tipdoc, docout_1.cantout, docout_1.cantouttmp, docout_1.lotout
  • Buffers: shared hit=13
34. 0.001 0.166 ↑ 1.0 1 1

Group (cost=8.13..8.15 rows=1 width=4) (actual time=0.165..0.166 rows=1 loops=1)

  • Output: comenzi_info_1.cmdid
  • Group Key: comenzi_info_1.cmdid
  • Buffers: shared hit=10
35. 0.000 0.165 ↑ 1.0 1 1

Group (cost=8.13..8.14 rows=1 width=8) (actual time=0.164..0.165 rows=1 loops=1)

  • Output: comenzi_info_1.cmdid, comenzi_out_4.idcmdout
  • Group Key: comenzi_info_1.cmdid, comenzi_out_4.idcmdout
  • Buffers: shared hit=10
36.          

Initplan (forGroup)

37. 0.017 0.017 ↑ 1.0 1 1

Index Scan using idxallvarslowerusername on public.myvars myvars_4 (cost=0.15..2.17 rows=1 width=8) (actual time=0.017..0.017 rows=1 loops=1)

  • Output: myvars_4.ic_mask
  • Index Cond: (lower((myvars_4.username)::text) = lower((("current_user"())::text)::text))
  • Buffers: shared hit=2
38. 0.007 0.164 ↑ 1.0 1 1

Sort (cost=5.96..5.96 rows=1 width=8) (actual time=0.163..0.164 rows=1 loops=1)

  • Output: comenzi_info_1.cmdid, comenzi_out_4.idcmdout
  • Sort Key: comenzi_info_1.cmdid, comenzi_out_4.idcmdout
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=10
39. 0.157 0.157 ↑ 1.0 1 1

Nested Loop (cost=0.85..5.95 rows=1 width=8) (actual time=0.156..0.157 rows=1 loops=1)

  • Output: comenzi_info_1.cmdid, comenzi_out_4.idcmdout
  • Buffers: shared hit=10
  • -> Index Scan using idxcomenzi_outprod_type on public.comenzi_out comenzi_out_4 (cost=0.43..2.70 rows=1 width=4) (actual time=0.144..0.145 (...)
  • Output: comenzi_out_4.idcmdout, comenzi_out_4.cmdid, comenzi_out_4.artid, comenzi_out_4.refnr_client, comenzi_out_4.cmdoutculoare, com (...)
  • Index Cond: ((comenzi_out_4.prod_type)::text = 'woodothers'::text)
  • Filter: (yweek(date(comenzi_out_4.cmdoutdataprod)) = ($4)::text)
  • Rows Removed by Filter: 2
  • Buffers: shared hit=6
  • -> Index Scan using idxcmdinf_client_idcmdout on public.comenzi_info comenzi_info_1 (cost=0.42..3.22 rows=3 width=8) (actual time=0.004..0 (...)
  • Output: comenzi_info_1.idcmdinf, comenzi_info_1.cmdid, comenzi_info_1.cmdprocavans, comenzi_info_1.cmdscont, comenzi_info_1.cmdmoneda, (...)
  • Index Cond: (comenzi_info_1.client_idcmdout = comenzi_out_4.idcmdout)
  • Buffers: shared hit=4
40. 0.016 0.016 ↓ 0.0 0 1

Index Scan using idxdoccomandaout on public.docout docout_1 (cost=0.43..8.87 rows=24 width=23) (actual time=0.015..0.016 rows=0 loops=1)

  • Output: docout_1.idout, docout_1.lotout, docout_1.comandaout, docout_1.valid, docout_1.partener, docout_1.datdoc, docout_1.tipdoc, docout_1.nrdoc, docout_1.nr (...)
  • Index Cond: (docout_1.comandaout = comenzi_info_1.cmdid)
  • Buffers: shared hit=3
41. 0.000 0.000 ↓ 0.0 0

Index Scan using idxdocinlot on public.docin docin_1 (cost=0.43..0.48 rows=1 width=12) (never executed)

  • Output: docin_1.lot, docin_1.artid, docin_1.comandain, docin_1.gestid, docin_1.valid, docin_1.partener, docin_1.datdoc, docin_1.tipdoc, docin_1.nrdoc, docin_1.nrdoc (...)
  • Index Cond: (docin_1.lot = docout_1.lotout)
  • Filter: (CASE (docout_1.comandaout = 0) WHEN CASE_TEST_EXPR THEN docin_1.comandain ELSE docout_1.comandaout END <> 0)
42. 0.012 0.020 ↑ 1.0 1 2

Hash (cost=0.60..0.60 rows=1 width=8) (actual time=0.010..0.010 rows=1 loops=2)

  • Output: comenzi_out_2.artid, comenzi_out_2.cmdid
  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=8
43. 0.008 0.008 ↑ 1.0 1 2

Index Scan using idxcmdout_cmdid on public.comenzi_out comenzi_out_2 (cost=0.43..0.60 rows=1 width=8) (actual time=0.004..0.004 rows=1 loops=2)

  • Output: comenzi_out_2.artid, comenzi_out_2.cmdid
  • Index Cond: (comenzi_out_1.cmdid = comenzi_out_2.cmdid)
  • Filter: (comenzi_out_1.artid = comenzi_out_2.artid)
  • Rows Removed by Filter: 1
  • Buffers: shared hit=8
44. 0.012 0.012 ↑ 2.0 1 2

Index Scan using idxcmdin_cmdid on public.comenzi_in (cost=0.42..0.47 rows=2 width=15) (actual time=0.006..0.006 rows=1 loops=2)

  • Output: comenzi_in.idcmdin, comenzi_in.cmdid, comenzi_in.artid, comenzi_in.cmdindataliv, comenzi_in.cmdoutid, comenzi_in.info, comenzi_in.cant, comenzi_in.cantfail, comenzi_in.pretc, comen (...)
  • Index Cond: (comenzi_in.cmdid = comenzi_out_1.cmdid)
  • Buffers: shared hit=8
45. 0.004 1.148 ↑ 1.0 1 1

Materialize (cost=43.43..61.81 rows=1 width=288) (actual time=1.098..1.148 rows=1 loops=1)

  • Output: cmd_in_docs_rest_woodothers_selweek.idcmdin, cmd_in_docs_rest_woodothers_selweek.artid, cmd_in_docs_rest_woodothers_selweek.cmdnr, cmd_in_docs_rest_woodothers_selweek.client_idcmdout, cmd_in_docs_rest_woo (...)
  • Buffers: shared hit=76
46. 0.008 1.144 ↑ 1.0 1 1

Merge Left Join (cost=43.43..61.81 rows=1 width=288) (actual time=1.094..1.144 rows=1 loops=1)

  • Output: cmd_in_docs_rest_woodothers_selweek.idcmdin, cmd_in_docs_rest_woodothers_selweek.artid, cmd_in_docs_rest_woodothers_selweek.cmdnr, cmd_in_docs_rest_woodothers_selweek.client_idcmdout, cmd_in_docs_re (...)
  • Merge Cond: ((cmd_in_docs_rest_woodothers_selweek.idcmd = comenzi_in_2.cmdoutid) AND (cmd_in_docs_rest_woodothers_selweek.artid = comenzi_in_2.artid))
  • Buffers: shared hit=76
47. 0.016 0.901 ↑ 1.0 1 1

Nested Loop Left Join (cost=32.71..50.99 rows=1 width=256) (actual time=0.853..0.901 rows=1 loops=1)

  • Output: cmd_in_docs_rest_woodothers_selweek.idcmdin, cmd_in_docs_rest_woodothers_selweek.artid, cmd_in_docs_rest_woodothers_selweek.cmdnr, cmd_in_docs_rest_woodothers_selweek.client_idcmdout, cmd_in_d (...)
  • Buffers: shared hit=62
48. 0.015 0.871 ↑ 1.0 1 1

Nested Loop Left Join (cost=32.57..48.82 rows=1 width=241) (actual time=0.830..0.871 rows=1 loops=1)

  • Output: cmd_in_docs_rest_woodothers_selweek.idcmdin, cmd_in_docs_rest_woodothers_selweek.artid, cmd_in_docs_rest_woodothers_selweek.cmdnr, cmd_in_docs_rest_woodothers_selweek.client_idcmdout, cm (...)
  • Join Filter: ((comenzi_out.woodcod)::text = (product_esentalemn.esentacod)::text)
  • Rows Removed by Join Filter: 32
  • Buffers: shared hit=60
49. 0.011 0.839 ↑ 1.0 1 1

Nested Loop Left Join (cost=32.57..47.08 rows=1 width=227) (actual time=0.804..0.839 rows=1 loops=1)

  • Output: cmd_in_docs_rest_woodothers_selweek.idcmdin, cmd_in_docs_rest_woodothers_selweek.artid, cmd_in_docs_rest_woodothers_selweek.cmdnr, cmd_in_docs_rest_woodothers_selweek.client_idcmdo (...)
  • Buffers: shared hit=59
50. 0.013 0.823 ↑ 1.0 1 1

Nested Loop Left Join (cost=32.43..44.91 rows=1 width=209) (actual time=0.790..0.823 rows=1 loops=1)

  • Output: cmd_in_docs_rest_woodothers_selweek.idcmdin, cmd_in_docs_rest_woodothers_selweek.artid, cmd_in_docs_rest_woodothers_selweek.cmdnr, cmd_in_docs_rest_woodothers_selweek.client_ (...)
  • Buffers: shared hit=57
51. 0.011 0.800 ↑ 1.0 1 1

Nested Loop (cost=32.28..42.74 rows=1 width=195) (actual time=0.769..0.800 rows=1 loops=1)

  • Output: cmd_in_docs_rest_woodothers_selweek.idcmdin, cmd_in_docs_rest_woodothers_selweek.artid, cmd_in_docs_rest_woodothers_selweek.cmdnr, cmd_in_docs_rest_woodothers_selweek.c (...)
  • Buffers: shared hit=55
52. 0.016 0.763 ↑ 1.0 1 1

Nested Loop (cost=32.01..40.43 rows=1 width=195) (actual time=0.745..0.763 rows=1 loops=1)

  • Output: cmd_in_docs_rest_woodothers_selweek.idcmdin, cmd_in_docs_rest_woodothers_selweek.artid, cmd_in_docs_rest_woodothers_selweek.cmdnr, cmd_in_docs_rest_woodothers_sel (...)
  • Buffers: shared hit=51
53. 0.014 0.742 ↑ 1.0 1 1

Nested Loop (cost=31.72..38.12 rows=1 width=168) (actual time=0.728..0.742 rows=1 loops=1)

  • Output: cmd_in_docs_rest_woodothers_selweek.idcmdin, cmd_in_docs_rest_woodothers_selweek.artid, cmd_in_docs_rest_woodothers_selweek.cmdnr, cmd_in_docs_rest_woodothe (...)
  • Join Filter: (cmd_in_docs_rest_woodothers_selweek.client_idcmdout = comenzi_out.idcmdout)
  • Buffers: shared hit=48
54. 0.030 0.624 ↑ 1.0 1 1

Nested Loop (cost=31.29..35.41 rows=1 width=153) (actual time=0.616..0.624 rows=1 loops=1)

  • Output: cmd_in_docs_rest_woodothers_selweek.idcmdin, cmd_in_docs_rest_woodothers_selweek.artid, cmd_in_docs_rest_woodothers_selweek.cmdnr, cmd_in_docs_rest_wo (...)
  • Buffers: shared hit=44
55. 0.013 0.575 ↑ 1.0 1 1

Nested Loop (cost=31.16..35.23 rows=1 width=133) (actual time=0.570..0.575 rows=1 loops=1)

  • Output: cmd_in_docs_rest_woodothers_selweek.idcmdin, cmd_in_docs_rest_woodothers_selweek.artid, cmd_in_docs_rest_woodothers_selweek.cmdnr, cmd_in_docs_r (...)
  • Buffers: shared hit=42
56. 0.050 0.557 ↑ 1.0 1 1

Nested Loop (cost=30.88..32.92 rows=1 width=92) (actual time=0.554..0.557 rows=1 loops=1)

  • Output: cmd_in_docs_rest_woodothers_selweek.idcmdin, cmd_in_docs_rest_woodothers_selweek.artid, cmd_in_docs_rest_woodothers_selweek.cmdnr, cmd_in_ (...)
  • Buffers: shared hit=39
  • -> Index Only Scan using idxplanprodfaze_cmdid on public.planificare_prodfaze ppf (cost=0.42..2.44 rows=1 width=4) (actual time=0.020..0.022 row (...)
57. 0.011 0.507 ↑ 1.0 1 1

Sort (cost=30.46..30.46 rows=1 width=3,376) (actual time=0.506..0.507 rows=1 loops=1)

  • Output: cmd_in_docs_rest_woodothers_selweek.idcmd, cmd_in_docs_rest_woodothers_selweek.cmdnr, cmd_in_docs_rest_woodothers_selweek.cmdpart, N (...)
  • Sort Key: cmd_in_docs_rest_woodothers_selweek.idcmd, cmd_in_docs_rest_woodothers_selweek.artid
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=35
  • Output: ppf.cmdid
  • Index Cond: (ppf.cmdid = cmd_in_docs_rest_woodothers_selweek.idcmd)
  • Heap Fetches: 1
  • Buffers: shared hit=4
58. 0.007 0.496 ↑ 1.0 1 1

Subquery Scan on cmd_in_docs_rest_woodothers_selweek (cost=27.80..30.45 rows=1 width=3,376) (actual time=0.494..0.496 rows=1 loops=1)

  • Output: cmd_in_docs_rest_woodothers_selweek.idcmd, cmd_in_docs_rest_woodothers_selweek.cmdnr, cmd_in_docs_rest_woodothers_selweek.cmdp (...)
  • Buffers: shared hit=35
59. 0.047 0.489 ↑ 1.0 1 1

Nested Loop Left Join (cost=27.80..30.44 rows=1 width=3,376) (actual time=0.486..0.489 rows=1 loops=1)

  • Output: comenzi.idcmd, comenzi.cmdnr, comenzi.cmdpart, NULL::timestamp without time zone, NULL::integer, NULL::character varying (...)
  • Join Filter: ((comenzi_in_1.cmdid = docin_2.comandain) AND (comenzi_in_1.artid = docin_2.artid))
  • Buffers: shared hit=35
60. 0.013 0.257 ↑ 1.0 1 1

Nested Loop (cost=9.39..11.59 rows=1 width=80) (actual time=0.255..0.257 rows=1 loops=1)

  • Output: comenzi.idcmd, comenzi.cmdnr, comenzi.cmdpart, comenzi.cmdtip, comenzi_info_2.partrefnr, comenzi_info_2.client_idc (...)
  • Buffers: shared hit=22
  • -> Index Scan using idxcmdin_cmdid on public.comenzi_in comenzi_in_1 (cost=0.42..0.49 rows=2 width=27) (actual time=0.00 (...)
61. 0.022 0.244 ↑ 1.0 1 1

Nested Loop Left Join (cost=8.97..11.08 rows=1 width=57) (actual time=0.243..0.244 rows=1 loops=1)

  • Output: comenzi.idcmd, comenzi.cmdnr, comenzi.cmdpart, comenzi.cmdtip, comenzi_info_2.partrefnr, comenzi_info_2.clie (...)
  • Buffers: shared hit=18
  • -> Index Scan using idxcmdinf_cmdid on public.comenzi_info comenzi_info_2 (cost=0.42..0.47 rows=1 width=13) (actua (...)
  • Output: comenzi_in_1.idcmdin, comenzi_in_1.cmdid, comenzi_in_1.artid, comenzi_in_1.cmdindataliv, comenzi_in_1.cmdout (...)
  • Index Cond: (comenzi_in_1.cmdid = comenzi.idcmd)
  • Buffers: shared hit=4
62. 0.038 0.222 ↑ 1.0 1 1

Nested Loop (cost=8.55..10.60 rows=1 width=48) (actual time=0.221..0.222 rows=1 loops=1)

  • Output: comenzi.idcmd, comenzi.cmdnr, comenzi.cmdpart, comenzi.cmdtip, comenzi_info_3.cmdid
  • Buffers: shared hit=14
  • -> Index Scan using idxcmd_id on public.comenzi (cost=0.42..2.44 rows=1 width=44) (actual time=0.025..0.025 (...)
  • Output: comenzi_info_2.idcmdinf, comenzi_info_2.cmdid, comenzi_info_2.cmdprocavans, comenzi_info_2.cmdscont, c (...)
  • Index Cond: (comenzi.idcmd = comenzi_info_2.cmdid)
  • Buffers: shared hit=4
63. 0.001 0.184 ↑ 1.0 1 1

Group (cost=8.13..8.14 rows=1 width=8) (actual time=0.184..0.184 rows=1 loops=1)

  • Output: comenzi_info_3.cmdid, comenzi_out_5.idcmdout
  • Group Key: comenzi_info_3.cmdid, comenzi_out_5.idcmdout
  • Buffers: shared hit=10
  • -> Index Scan using idxallvarslowerusername on public.myvars (cost=0.15..2.17 rows=1 width=8) (actua (...)
  • Output: myvars.ic_mask
  • Index Cond: (lower((myvars.username)::text) = lower((("current_user"())::text)::text))
  • Buffers: shared hit=2
  • Output: comenzi.idcmd, comenzi.cmdvalid, comenzi.cmdnr, comenzi.cmdpart, comenzi.cmddate, comenzi.cmdtip (...)
  • Index Cond: (comenzi.idcmd = comenzi_info_3.cmdid)
  • Filter: ((comenzi.cmdnr)::text ~~ '%'::text)
  • Buffers: shared hit=4
64.          

Initplan (forGroup)

65. 0.010 0.183 ↑ 1.0 1 1

Sort (cost=5.96..5.96 rows=1 width=8) (actual time=0.183..0.183 rows=1 loops=1)

  • Output: comenzi_info_3.cmdid, comenzi_out_5.idcmdout
  • Sort Key: comenzi_info_3.cmdid, comenzi_out_5.idcmdout
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=10
66. 0.173 0.173 ↑ 1.0 1 1

Nested Loop (cost=0.85..5.95 rows=1 width=8) (actual time=0.172..0.173 rows=1 loops=1)

  • Output: comenzi_info_3.cmdid, comenzi_out_5.idcmdout
  • Buffers: shared hit=10
  • -> Index Scan using idxcomenzi_outprod_type on public.comenzi_out comenzi_out_5 (cost=0.43 (...)
  • Output: comenzi_out_5.idcmdout, comenzi_out_5.cmdid, comenzi_out_5.artid, comenzi_out_ (...)
  • Index Cond: ((comenzi_out_5.prod_type)::text = 'woodothers'::text)
  • Filter: (yweek(date(comenzi_out_5.cmdoutdataprod)) = ($0)::text)
  • Rows Removed by Filter: 2
  • Buffers: shared hit=6
  • -> Index Scan using idxcmdinf_client_idcmdout on public.comenzi_info comenzi_info_3 (cost= (...)
  • Output: comenzi_info_3.idcmdinf, comenzi_info_3.cmdid, comenzi_info_3.cmdprocavans, co (...)
  • Index Cond: (comenzi_info_3.client_idcmdout = comenzi_out_5.idcmdout)
  • Buffers: shared hit=4
67. 0.005 0.185 ↓ 0.0 0 1

HashAggregate (cost=18.41..18.52 rows=11 width=48) (actual time=0.185..0.185 rows=0 loops=1)

  • Output: docin_2.comandain, docin_2.artid, sum((CASE ((docin_2.tipdoc)::text ~~ 'rec%'::text) WHEN CASE_TEST_EXPR THEN (doc (...)
  • Group Key: docin_2.comandain, docin_2.artid
  • Buffers: shared hit=13
68. 0.022 0.180 ↓ 0.0 0 1

Nested Loop (cost=8.55..18.13 rows=11 width=441) (actual time=0.180..0.180 rows=0 loops=1)

  • Output: NULL::integer, docin_2.comandain, NULL::timestamp without time zone, NULL::character varying(50), NULL::char (...)
  • Buffers: shared hit=13
  • -> Index Scan using idxdoccomandain on public.docin docin_2 (cost=0.43..9.60 rows=11 width=20) (actual time=0.006. (...)
69. 0.013 0.158 ↑ 1.0 1 1

Group (cost=8.13..8.14 rows=1 width=8) (actual time=0.158..0.158 rows=1 loops=1)

  • Output: comenzi_info_4.cmdid, comenzi_out_6.idcmdout
  • Group Key: comenzi_info_4.cmdid, comenzi_out_6.idcmdout
  • Buffers: shared hit=10
  • -> Index Scan using idxallvarslowerusername on public.myvars myvars_1 (cost=0.15..2.17 rows=1 width=8) (ac (...)
  • Output: myvars_1.ic_mask
  • Index Cond: (lower((myvars_1.username)::text) = lower((("current_user"())::text)::text))
  • Buffers: shared hit=2
  • Output: docin_2.lot, docin_2.artid, docin_2.comandain, docin_2.gestid, docin_2.valid, docin_2.partener, docin_ (...)
  • Index Cond: (docin_2.comandain = comenzi_info_4.cmdid)
  • Filter: (docin_2.valid AND (COALESCE((docin_2.comandain)::double precision, '0'::double precision) <> '0'::dou (...)
  • Buffers: shared hit=3
70.          

Initplan (forGroup)

71. 0.005 0.145 ↑ 1.0 1 1

Sort (cost=5.96..5.96 rows=1 width=8) (actual time=0.145..0.145 rows=1 loops=1)

  • Output: comenzi_info_4.cmdid, comenzi_out_6.idcmdout
  • Sort Key: comenzi_info_4.cmdid, comenzi_out_6.idcmdout
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=10
72. 0.140 0.140 ↑ 1.0 1 1

Nested Loop (cost=0.85..5.95 rows=1 width=8) (actual time=0.139..0.140 rows=1 loops=1)

  • Output: comenzi_info_4.cmdid, comenzi_out_6.idcmdout
  • Buffers: shared hit=10
  • -> Index Scan using idxcomenzi_outprod_type on public.comenzi_out comenzi_out_6 (cost=0.43..2.70 (...)
  • Output: comenzi_out_6.idcmdout, comenzi_out_6.cmdid, comenzi_out_6.artid, comenzi_out_6.refn (...)
  • Index Cond: ((comenzi_out_6.prod_type)::text = 'woodothers'::text)
  • Filter: (yweek(date(comenzi_out_6.cmdoutdataprod)) = ($1)::text)
  • Rows Removed by Filter: 2
  • Buffers: shared hit=6
  • -> Index Scan using idxcmdinf_client_idcmdout on public.comenzi_info comenzi_info_4 (cost=0.42.. (...)
  • Output: comenzi_info_4.idcmdinf, comenzi_info_4.cmdid, comenzi_info_4.cmdprocavans, comenzi_ (...)
  • Index Cond: (comenzi_info_4.client_idcmdout = comenzi_out_6.idcmdout)
  • Buffers: shared hit=4
73. 0.005 0.005 ↑ 1.0 1 1

Index Scan using idxart_idart on public.articole (cost=0.29..2.30 rows=1 width=41) (actual time=0.004..0.005 rows=1 loops=1)

  • Output: articole.idart, articole.categorie, articole.grupa, articole.subgrupa, articole.brand, articole.denumire, articole.cod, articole.um, artic (...)
  • Index Cond: (articole.idart = cmd_in_docs_rest_woodothers_selweek.artid)
  • Buffers: shared hit=3
74. 0.019 0.019 ↑ 1.0 1 1

Index Scan using idxprod_faze_idfaza on public.product_faze (cost=0.13..0.17 rows=1 width=24) (actual time=0.017..0.019 rows=1 loops=1)

  • Output: product_faze.idfaza, product_faze.faza, product_faze.fgestpred, product_faze.shifts, product_faze.medworkers, product_faze.medunits, product_faz (...)
  • Index Cond: (product_faze.idfaza = articole.fazaart)
  • Filter: ((((product_faze.faza)::text || ' -- id:'::text) || CASE WHEN ((product_faze.idfaza)::double precision IS NULL) THEN ''::text ELSE (product_faze (...)
  • Buffers: shared hit=2
75. 0.104 0.104 ↑ 1.0 1 1

Index Scan using idxcomenzi_outprod_type on public.comenzi_out (cost=0.43..2.70 rows=1 width=19) (actual time=0.099..0.104 rows=1 loops=1)

  • Output: comenzi_out.idcmdout, comenzi_out.cmdid, comenzi_out.artid, comenzi_out.refnr_client, comenzi_out.cmdoutculoare, comenzi_out.cmdoutdataliv, comenzi_ou (...)
  • Index Cond: ((comenzi_out.prod_type)::text = 'woodothers'::text)
  • Filter: (yweek(date(comenzi_out.cmdoutdataprod)) = '2019_w19'::text)
  • Rows Removed by Filter: 2
  • Buffers: shared hit=4
76. 0.005 0.005 ↑ 1.0 1 1

Index Scan using idxart_idart on public.articole a2 (cost=0.29..2.30 rows=1 width=35) (actual time=0.004..0.005 rows=1 loops=1)

  • Output: a2.idart, a2.categorie, a2.grupa, a2.subgrupa, a2.brand, a2.denumire, a2.cod, a2.um, a2.pretalista, a2.adaoslista, a2.pretlista, a2.monedalista, a2.adaos_le (...)
  • Index Cond: (a2.idart = comenzi_out.artid)
  • Buffers: shared hit=3
77. 0.026 0.026 ↑ 1.0 1 1

Index Only Scan using idxpartenerinume on public.parteneri (cost=0.28..2.29 rows=1 width=19) (actual time=0.012..0.026 rows=1 loops=1)

  • Output: parteneri.nume
  • Index Cond: (parteneri.nume = (cmd_in_docs_rest_woodothers_selweek.cmdpart)::text)
  • Heap Fetches: 1
  • Buffers: shared hit=4
78. 0.010 0.010 ↑ 1.0 1 1

Index Scan using idx_mygestiuni_idgest on public.mygestiuni mygestiunis (cost=0.14..2.16 rows=1 width=22) (actual time=0.010..0.010 rows=1 loops=1)

  • Output: mygestiunis.idgest, mygestiunis.centru, mygestiunis.grupagestiune, mygestiunis.gestiune, mygestiunis.cont, mygestiunis.tipevmarf, mygestiunis.gestinfo, mygestiunis.gest (...)
  • Index Cond: (product_faze.fgestpredwoodothers = mygestiunis.idgest)
  • Buffers: shared hit=2
79. 0.005 0.005 ↑ 1.0 1 1

Index Scan using idx_mygestiuni_idgest on public.mygestiuni mygestiunid (cost=0.14..2.16 rows=1 width=22) (actual time=0.002..0.005 rows=1 loops=1)

  • Output: mygestiunid.idgest, mygestiunid.centru, mygestiunid.grupagestiune, mygestiunid.gestiune, mygestiunid.cont, mygestiunid.tipevmarf, mygestiunid.gestinfo, mygestiunid.gestcatid, (...)
  • Index Cond: (product_faze.fgestlanswoodothers = mygestiunid.idgest)
  • Buffers: shared hit=2
80. 0.017 0.017 ↑ 1.0 33 1

Seq Scan on public.product_esentalemn (cost=0.00..1.33 rows=33 width=16) (actual time=0.012..0.017 rows=33 loops=1)

  • Output: product_esentalemn.idel, product_esentalemn.esentacod, product_esentalemn.esentalemn, product_esentalemn.grosimetop_default, product_esentalemn.userid, product_esentalemn.datemodif (...)
  • Buffers: shared hit=1
81. 0.014 0.014 ↑ 1.0 1 1

Index Scan using idxcolors_finisaj_colorcod on public.product_colors_finisaj (cost=0.14..2.16 rows=1 width=18) (actual time=0.009..0.014 rows=1 loops=1)

  • Output: product_colors_finisaj.idclf, product_colors_finisaj.colorcod, product_colors_finisaj.color, product_colors_finisaj.userid, product_colors_finisaj.datemodified, product_colors_finisaj.fi (...)
  • Index Cond: ((comenzi_out.finisajcod)::text = (product_colors_finisaj.colorcod)::text)
  • Buffers: shared hit=2
82. 0.002 0.235 ↓ 0.0 0 1

Materialize (cost=10.72..10.79 rows=2 width=40) (actual time=0.235..0.235 rows=0 loops=1)

  • Output: comenzi_in_2.cmdoutid, comenzi_in_2.artid, (sum((comenzi_in_2.cant - comenzi_in_2.cantfail)))
  • Buffers: shared hit=14
83. 0.002 0.233 ↓ 0.0 0 1

GroupAggregate (cost=10.72..10.77 rows=2 width=40) (actual time=0.233..0.233 rows=0 loops=1)

  • Output: comenzi_in_2.cmdoutid, comenzi_in_2.artid, sum((comenzi_in_2.cant - comenzi_in_2.cantfail))
  • Group Key: comenzi_in_2.cmdoutid, comenzi_in_2.artid
  • Buffers: shared hit=14
84. 0.005 0.231 ↓ 0.0 0 1

Sort (cost=10.72..10.72 rows=2 width=15) (actual time=0.231..0.231 rows=0 loops=1)

  • Output: comenzi_in_2.cmdoutid, comenzi_in_2.artid, comenzi_in_2.cant, comenzi_in_2.cantfail
  • Sort Key: comenzi_in_2.cmdoutid, comenzi_in_2.artid
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=14
85. 0.011 0.226 ↓ 0.0 0 1

Nested Loop (cost=8.55..10.71 rows=2 width=15) (actual time=0.226..0.226 rows=0 loops=1)

  • Output: comenzi_in_2.cmdoutid, comenzi_in_2.artid, comenzi_in_2.cant, comenzi_in_2.cantfail
  • Buffers: shared hit=14
86. 0.001 0.181 ↑ 1.0 1 1

Group (cost=8.13..8.15 rows=1 width=4) (actual time=0.180..0.181 rows=1 loops=1)

  • Output: comenzi_info_5.cmdid
  • Group Key: comenzi_info_5.cmdid
  • Buffers: shared hit=10
87. 0.000 0.180 ↑ 1.0 1 1

Group (cost=8.13..8.14 rows=1 width=8) (actual time=0.179..0.180 rows=1 loops=1)

  • Output: comenzi_info_5.cmdid, comenzi_out_7.idcmdout
  • Group Key: comenzi_info_5.cmdid, comenzi_out_7.idcmdout
  • Buffers: shared hit=10
88.          

Initplan (forGroup)

89. 0.015 0.015 ↑ 1.0 1 1

Index Scan using idxallvarslowerusername on public.myvars myvars_2 (cost=0.15..2.17 rows=1 width=8) (actual time=0.015..0.015 rows=1 loops=1)

  • Output: myvars_2.ic_mask
  • Index Cond: (lower((myvars_2.username)::text) = lower((("current_user"())::text)::text))
  • Buffers: shared hit=2
90. 0.007 0.178 ↑ 1.0 1 1

Sort (cost=5.96..5.96 rows=1 width=8) (actual time=0.178..0.178 rows=1 loops=1)

  • Output: comenzi_info_5.cmdid, comenzi_out_7.idcmdout
  • Sort Key: comenzi_info_5.cmdid, comenzi_out_7.idcmdout
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=10
91. 0.013 0.171 ↑ 1.0 1 1

Nested Loop (cost=0.85..5.95 rows=1 width=8) (actual time=0.169..0.171 rows=1 loops=1)

  • Output: comenzi_info_5.cmdid, comenzi_out_7.idcmdout
  • Buffers: shared hit=10
  • -> Index Scan using idxcmdinf_client_idcmdout on public.comenzi_info comenzi_info_5 (cost=0.42..3.22 rows=3 width=8) (actual time=0.004..0.004 rows=1 loops= (...)
92. 0.158 0.158 ↑ 1.0 1 1

Index Scan using idxcomenzi_outprod_type on public.comenzi_out comenzi_out_7 (cost=0.43..2.70 rows=1 width=4) (actual time=0.157..0.158 rows=1 loops=1)

  • Output: comenzi_out_7.idcmdout, comenzi_out_7.cmdid, comenzi_out_7.artid, comenzi_out_7.refnr_client, comenzi_out_7.cmdoutculoare, comenzi_out_7.cmdoutd (...)
  • Index Cond: ((comenzi_out_7.prod_type)::text = 'woodothers'::text)
  • Filter: (yweek(date(comenzi_out_7.cmdoutdataprod)) = ($2)::text)
  • Rows Removed by Filter: 2
  • Buffers: shared hit=6
  • Output: comenzi_info_5.idcmdinf, comenzi_info_5.cmdid, comenzi_info_5.cmdprocavans, comenzi_info_5.cmdscont, comenzi_info_5.cmdmoneda, comenzi_info_5.pa (...)
  • Index Cond: (comenzi_info_5.client_idcmdout = comenzi_out_7.idcmdout)
  • Buffers: shared hit=4
93. 0.034 0.034 ↓ 0.0 0 1

Index Scan using idxcmdin_cmdid on public.comenzi_in comenzi_in_2 (cost=0.42..2.53 rows=2 width=19) (actual time=0.034..0.034 rows=0 loops=1)

  • Output: comenzi_in_2.idcmdin, comenzi_in_2.cmdid, comenzi_in_2.artid, comenzi_in_2.cmdindataliv, comenzi_in_2.cmdoutid, comenzi_in_2.info, comenzi_in_2.cant, comenzi_in_2.cantf (...)
  • Index Cond: (comenzi_in_2.cmdid = comenzi_info_5.cmdid)
  • Filter: ((CASE WHEN ((btrim((comenzi_in_2.cmdoutid)::text) = ''::text) OR (comenzi_in_2.cmdoutid IS NULL) OR ((comenzi_in_2.cmdoutid)::text ~ '[:-~!-,/]'::text)) THEN 0 ELSE CO (...)
  • Rows Removed by Filter: 1
  • Buffers: shared hit=4
94. 0.002 0.311 ↑ 7.0 1 1

Materialize (cost=6,541.13..6,541.36 rows=7 width=16) (actual time=0.310..0.311 rows=1 loops=1)

  • Output: cl0_1.cmdid, cl0_1.artid, (max(cl0_1.cantlansatdate))
  • Buffers: shared hit=31
95. 0.006 0.309 ↑ 7.0 1 1

GroupAggregate (cost=6,541.13..6,541.27 rows=7 width=16) (actual time=0.309..0.309 rows=1 loops=1)

  • Output: cl0_1.cmdid, cl0_1.artid, max(cl0_1.cantlansatdate)
  • Group Key: cl0_1.cmdid, cl0_1.artid
  • Buffers: shared hit=31
96. 0.005 0.303 ↑ 3.5 2 1

Sort (cost=6,541.13..6,541.15 rows=7 width=16) (actual time=0.302..0.303 rows=2 loops=1)

  • Output: cl0_1.cmdid, cl0_1.artid, cl0_1.cantlansatdate
  • Sort Key: cl0_1.cmdid, cl0_1.artid
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=31
97. 0.000 0.298 ↑ 3.5 2 1

Subquery Scan on cl0_1 (cost=6,540.94..6,541.03 rows=7 width=16) (actual time=0.297..0.298 rows=2 loops=1)

  • Output: cl0_1.cmdid, cl0_1.artid, cl0_1.cantlansatdate
  • Buffers: shared hit=31
98. 0.011 0.298 ↑ 3.5 2 1

Sort (cost=6,540.94..6,540.96 rows=7 width=72) (actual time=0.296..0.298 rows=2 loops=1)

  • Output: comenzi_in_3.cmdid, comenzi_in_3.artid, NULL::numeric(26,10), NULL::numeric(26,10), NULL::double precision, (CASE ((comenzi_out_8.cant - comenzi_out_8.cantfail) = '0'::numeric) WHEN CASE (...)
  • Sort Key: comenzi_in_3.cmdid
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=31
99. 0.028 0.287 ↑ 3.5 2 1

Nested Loop (cost=6,502.04..6,540.85 rows=7 width=72) (actual time=0.282..0.287 rows=2 loops=1)

  • Output: comenzi_in_3.cmdid, comenzi_in_3.artid, NULL::numeric(26,10), NULL::numeric(26,10), NULL::double precision, CASE ((comenzi_out_8.cant - comenzi_out_8.cantfail) = '0'::numeric) WHEN (...)
  • Join Filter: (comenzi_info_6.cmdid = comenzi_in_3.cmdid)
  • Buffers: shared hit=31
100. 0.012 0.255 ↑ 2.0 2 1

Hash Right Join (cost=6,501.61..6,538.75 rows=4 width=24) (actual time=0.253..0.255 rows=2 loops=1)

  • Output: comenzi_info_6.cmdid, comenzi_out_8.cant, comenzi_out_8.cantfail, comenzi_out_8.cmdid, (sum((CASE ((docout_2.tipdoc)::text ~~ 'lansliv%'::text) WHEN CASE_TEST_EXPR THEN (doco (...)
  • Hash Cond: ((docin_3.artid = comenzi_out_8.artid) AND (docout_2.comandaout = comenzi_out_8.cmdid))
  • Buffers: shared hit=23
101. 0.014 0.034 ↓ 0.0 0 1

HashAggregate (cost=6,488.15..6,501.65 rows=1,350 width=24) (actual time=0.034..0.034 rows=0 loops=1)

  • Output: docout_2.comandaout, docin_3.artid, docout_2.datdoc, sum((CASE ((docout_2.tipdoc)::text ~~ 'lansliv%'::text) WHEN CASE_TEST_EXPR THEN (docout_2.cantout)::double precisi (...)
  • Group Key: docout_2.comandaout, docin_3.artid, docout_2.datdoc
  • Buffers: shared hit=3
102. 0.002 0.020 ↓ 0.0 0 1

Nested Loop (cost=1.28..6,474.65 rows=1,350 width=24) (actual time=0.020..0.020 rows=0 loops=1)

  • Output: docout_2.comandaout, docin_3.artid, docout_2.datdoc, (CASE ((docout_2.tipdoc)::text ~~ 'lansliv%'::text) WHEN CASE_TEST_EXPR THEN (docout_2.cantout)::double preci (...)
  • Buffers: shared hit=3
103. 0.003 0.018 ↓ 0.0 0 1

Nested Loop (cost=0.86..3,325.90 rows=1,350 width=469) (actual time=0.018..0.018 rows=0 loops=1)

  • Output: docout_2.comandaout, NULL::integer, docout_2.datdoc, NULL::character varying(50), NULL::character varying(250), NULL::character varying(250), docout_2.lotou (...)
  • Buffers: shared hit=3
104. 0.015 0.015 ↓ 0.0 0 1

Index Scan using idxdocoutddoc on public.docout docout_2 (cost=0.43..100.18 rows=1,357 width=31) (actual time=0.015..0.015 rows=0 loops=1)

  • Output: docout_2.idout, docout_2.lotout, docout_2.comandaout, docout_2.valid, docout_2.partener, docout_2.datdoc, docout_2.tipdoc, docout_2.nrdoc, docout_2.nr (...)
  • Index Cond: (docout_2.datdoc = '2019-05-15'::date)
  • Buffers: shared hit=3
105. 0.000 0.000 ↓ 0.0 0

Index Scan using idxdocinlot on public.docin docin_4 (cost=0.43..2.32 rows=1 width=8) (never executed)

  • Output: docin_4.lot, docin_4.artid, docin_4.comandain, docin_4.gestid, docin_4.valid, docin_4.partener, docin_4.datdoc, docin_4.tipdoc, docin_4.nrdoc, docin_4 (...)
  • Index Cond: (docin_4.lot = docout_2.lotout)
  • Filter: (CASE (docout_2.comandaout = 0) WHEN CASE_TEST_EXPR THEN docin_4.comandain ELSE docout_2.comandaout END <> 0)
106. 0.000 0.000 ↓ 0.0 0

Index Scan using idxdocinlot on public.docin docin_3 (cost=0.43..2.31 rows=1 width=8) (never executed)

  • Output: docin_3.lot, docin_3.artid, docin_3.comandain, docin_3.gestid, docin_3.valid, docin_3.partener, docin_3.datdoc, docin_3.tipdoc, docin_3.nrdoc, docin_3.nrdoc (...)
  • Index Cond: (docin_3.lot = docout_2.lotout)
107. 0.008 0.209 ↑ 2.0 2 1

Hash (cost=13.41..13.41 rows=4 width=20) (actual time=0.209..0.209 rows=2 loops=1)

  • Output: comenzi_info_6.cmdid, comenzi_out_8.cant, comenzi_out_8.cantfail, comenzi_out_8.cmdid, comenzi_out_8.artid
  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
  • Buffers: shared hit=20
108. 0.006 0.201 ↑ 2.0 2 1

Nested Loop (cost=8.84..13.41 rows=4 width=20) (actual time=0.196..0.201 rows=2 loops=1)

  • Output: comenzi_info_6.cmdid, comenzi_out_8.cant, comenzi_out_8.cantfail, comenzi_out_8.cmdid, comenzi_out_8.artid
  • Buffers: shared hit=20
109. 0.012 0.181 ↑ 3.5 2 1

Nested Loop (cost=8.55..11.19 rows=7 width=20) (actual time=0.179..0.181 rows=2 loops=1)

  • Output: comenzi_info_6.cmdid, comenzi_out_8.cant, comenzi_out_8.cantfail, comenzi_out_8.cmdid, comenzi_out_8.artid
  • Buffers: shared hit=14
110. 0.001 0.166 ↑ 1.0 1 1

Group (cost=8.13..8.15 rows=1 width=4) (actual time=0.165..0.166 rows=1 loops=1)

  • Output: comenzi_info_6.cmdid
  • Group Key: comenzi_info_6.cmdid
  • Buffers: shared hit=10
111. 0.000 0.165 ↑ 1.0 1 1

Group (cost=8.13..8.14 rows=1 width=8) (actual time=0.165..0.165 rows=1 loops=1)

  • Output: comenzi_info_6.cmdid, comenzi_out_9.idcmdout
  • Group Key: comenzi_info_6.cmdid, comenzi_out_9.idcmdout
  • Buffers: shared hit=10
112.          

Initplan (forGroup)

113. 0.014 0.014 ↑ 1.0 1 1

Index Scan using idxallvarslowerusername on public.myvars myvars_5 (cost=0.15..2.17 rows=1 width=8) (actual time=0.014..0.014 rows=1 loops=1)

  • Output: myvars_5.ic_mask
  • Index Cond: (lower((myvars_5.username)::text) = lower((("current_user"())::text)::text))
  • Buffers: shared hit=2
114. 0.005 0.162 ↑ 1.0 1 1

Sort (cost=5.96..5.96 rows=1 width=8) (actual time=0.162..0.162 rows=1 loops=1)

  • Output: comenzi_info_6.cmdid, comenzi_out_9.idcmdout
  • Sort Key: comenzi_info_6.cmdid, comenzi_out_9.idcmdout
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=10
115. 0.157 0.157 ↑ 1.0 1 1

Nested Loop (cost=0.85..5.95 rows=1 width=8) (actual time=0.155..0.157 rows=1 loops=1)

  • Output: comenzi_info_6.cmdid, comenzi_out_9.idcmdout
  • Buffers: shared hit=10
  • -> Index Scan using idxcomenzi_outprod_type on public.comenzi_out comenzi_out_9 (cost=0.43..2.70 rows=1 width=4) (actual time=0.141..0.142 (...)
  • Output: comenzi_out_9.idcmdout, comenzi_out_9.cmdid, comenzi_out_9.artid, comenzi_out_9.refnr_client, comenzi_out_9.cmdoutculoare, com (...)
  • Index Cond: ((comenzi_out_9.prod_type)::text = 'woodothers'::text)
  • Filter: (yweek(date(comenzi_out_9.cmdoutdataprod)) = ($5)::text)
  • Rows Removed by Filter: 2
  • Buffers: shared hit=6
  • -> Index Scan using idxcmdinf_client_idcmdout on public.comenzi_info comenzi_info_6 (cost=0.42..3.22 rows=3 width=8) (actual time=0.004..0 (...)
  • Output: comenzi_info_6.idcmdinf, comenzi_info_6.cmdid, comenzi_info_6.cmdprocavans, comenzi_info_6.cmdscont, comenzi_info_6.cmdmoneda, (...)
  • Index Cond: (comenzi_info_6.client_idcmdout = comenzi_out_9.idcmdout)
  • Buffers: shared hit=4
116. 0.003 0.003 ↑ 3.5 2 1

Index Scan using idxcmdout_cmdid on public.comenzi_out comenzi_out_8 (cost=0.43..2.96 rows=7 width=16) (actual time=0.003..0.003 rows=2 loops=1)

  • Output: comenzi_out_8.idcmdout, comenzi_out_8.cmdid, comenzi_out_8.artid, comenzi_out_8.refnr_client, comenzi_out_8.cmdoutculoare, comenzi_out_8.cmdoutdataliv (...)
  • Index Cond: (comenzi_out_8.cmdid = comenzi_info_6.cmdid)
  • Buffers: shared hit=4
117. 0.014 0.014 ↑ 1.0 1 2

Index Scan using idxart_idart on public.articole articole_2 (cost=0.29..0.31 rows=1 width=4) (actual time=0.006..0.007 rows=1 loops=2)

  • Output: articole_2.idart, articole_2.categorie, articole_2.grupa, articole_2.subgrupa, articole_2.brand, articole_2.denumire, articole_2.cod, articole_2.um, articol (...)
  • Index Cond: (articole_2.idart = comenzi_out_8.artid)
  • Filter: ((NOT articole_2.exclus_lansare) AND (articole_2.art_type = ANY ('{1,2,5}'::integer[])))
  • Buffers: shared hit=6
118. 0.004 0.004 ↑ 2.0 1 2

Index Scan using idxcmdin_cmdid on public.comenzi_in comenzi_in_3 (cost=0.42..0.46 rows=2 width=15) (actual time=0.002..0.002 rows=1 loops=2)

  • Output: comenzi_in_3.idcmdin, comenzi_in_3.cmdid, comenzi_in_3.artid, comenzi_in_3.cmdindataliv, comenzi_in_3.cmdoutid, comenzi_in_3.info, comenzi_in_3.cant, comenzi_in_3.cantfail, c (...)
  • Index Cond: (comenzi_in_3.cmdid = comenzi_out_8.cmdid)
  • Buffers: shared hit=8
119. 0.022 0.437 ↑ 1.0 1 1

GroupAggregate (cost=8.68..10.86 rows=1 width=108) (actual time=0.437..0.437 rows=1 loops=1)

  • Output: comenzi_in_pers.cmdid, comenzi_in_pers.dateplan, sum(comenzi_in_pers.cantplan), sum(comenzi_in_pers.cantrez), array_to_string(array_agg(DISTINCT (((product_muncitori.nume)::text || ' '::text) || (product_muncitori.prenume)::text)), ', (...)
  • Group Key: comenzi_in_pers.cmdid, comenzi_in_pers.dateplan
  • Buffers: shared hit=16
120. 0.009 0.415 ↑ 1.0 1 1

Nested Loop (cost=8.68..10.82 rows=1 width=33) (actual time=0.413..0.415 rows=1 loops=1)

  • Output: comenzi_in_pers.cmdid, comenzi_in_pers.dateplan, comenzi_in_pers.cantplan, comenzi_in_pers.cantrez, product_muncitori.nume, product_muncitori.prenume
  • Buffers: shared hit=16
121. 0.012 0.398 ↑ 1.0 1 1

Nested Loop (cost=8.54..10.61 rows=1 width=23) (actual time=0.398..0.398 rows=1 loops=1)

  • Output: comenzi_in_pers.cmdid, comenzi_in_pers.dateplan, comenzi_in_pers.cantplan, comenzi_in_pers.cantrez, comenzi_in_pers.munid
  • Buffers: shared hit=14
122. 0.003 0.369 ↑ 1.0 1 1

Group (cost=8.13..8.15 rows=1 width=4) (actual time=0.369..0.369 rows=1 loops=1)

  • Output: comenzi_info_7.cmdid
  • Group Key: comenzi_info_7.cmdid
  • Buffers: shared hit=10
123. 0.000 0.366 ↑ 1.0 1 1

Group (cost=8.13..8.14 rows=1 width=8) (actual time=0.366..0.366 rows=1 loops=1)

  • Output: comenzi_info_7.cmdid, comenzi_out_10.idcmdout
  • Group Key: comenzi_info_7.cmdid, comenzi_out_10.idcmdout
  • Buffers: shared hit=10
124.          

Initplan (forGroup)

125. 0.028 0.028 ↑ 1.0 1 1

Index Scan using idxallvarslowerusername on public.myvars myvars_6 (cost=0.15..2.17 rows=1 width=8) (actual time=0.028..0.028 rows=1 loops=1)

  • Output: myvars_6.ic_mask
  • Index Cond: (lower((myvars_6.username)::text) = lower((("current_user"())::text)::text))
  • Buffers: shared hit=2
126. 0.013 0.366 ↑ 1.0 1 1

Sort (cost=5.96..5.96 rows=1 width=8) (actual time=0.366..0.366 rows=1 loops=1)

  • Output: comenzi_info_7.cmdid, comenzi_out_10.idcmdout
  • Sort Key: comenzi_info_7.cmdid, comenzi_out_10.idcmdout
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=10
127. 0.010 0.353 ↑ 1.0 1 1

Nested Loop (cost=0.85..5.95 rows=1 width=8) (actual time=0.351..0.353 rows=1 loops=1)

  • Output: comenzi_info_7.cmdid, comenzi_out_10.idcmdout
  • Buffers: shared hit=10
128. 0.317 0.317 ↑ 1.0 1 1

Index Scan using idxcomenzi_outprod_type on public.comenzi_out comenzi_out_10 (cost=0.43..2.70 rows=1 width=4) (actual time=0.316..0.317 rows=1 loops=1)

  • Output: comenzi_out_10.idcmdout, comenzi_out_10.cmdid, comenzi_out_10.artid, comenzi_out_10.refnr_client, comenzi_out_10.cmdoutculoare, comenzi_out_10.cmdoutdataliv, comenzi_out_10.cmdoutscont, comenz (...)
  • Index Cond: ((comenzi_out_10.prod_type)::text = 'woodothers'::text)
  • Filter: (yweek(date(comenzi_out_10.cmdoutdataprod)) = ($6)::text)
  • Rows Removed by Filter: 2
  • Buffers: shared hit=6
129. 0.026 0.026 ↑ 3.0 1 1

Index Scan using idxcmdinf_client_idcmdout on public.comenzi_info comenzi_info_7 (cost=0.42..3.22 rows=3 width=8) (actual time=0.026..0.026 rows=1 loops=1)

  • Output: comenzi_info_7.idcmdinf, comenzi_info_7.cmdid, comenzi_info_7.cmdprocavans, comenzi_info_7.cmdscont, comenzi_info_7.cmdmoneda, comenzi_info_7.partrefnr, comenzi_info_7.producator, comenzi_info (...)
  • Index Cond: (comenzi_info_7.client_idcmdout = comenzi_out_10.idcmdout)
  • Buffers: shared hit=4
130. 0.017 0.017 ↑ 1.0 1 1

Index Scan using idxcomenzi_in_pers_cmdid on public.comenzi_in_pers (cost=0.42..2.44 rows=1 width=23) (actual time=0.017..0.017 rows=1 loops=1)

  • Output: comenzi_in_pers.idcip, comenzi_in_pers.cmdid, comenzi_in_pers.munid, comenzi_in_pers.dateplan, comenzi_in_pers.cantplan, comenzi_in_pers.cantrez
  • Index Cond: (comenzi_in_pers.cmdid = comenzi_info_7.cmdid)
  • Filter: (comenzi_in_pers.dateplan = '2019-05-15'::date)
  • Buffers: shared hit=4
131. 0.008 0.008 ↑ 1.0 1 1

Index Scan using pka_prod_mun_idmun on public.product_muncitori (cost=0.14..0.20 rows=1 width=18) (actual time=0.007..0.008 rows=1 loops=1)

  • Output: product_muncitori.idmun, product_muncitori.cnpa, product_muncitori.nume, product_muncitori.prenume, product_muncitori.userid, product_muncitori.datemodified, product_muncitori.fazaid, product_muncitori.inactiv
  • Index Cond: (product_muncitori.idmun = comenzi_in_pers.munid)
  • Buffers: shared hit=2