explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hVJq

Settings
# exclusive inclusive rows x rows loops node
1. 0.753 277.682 ↑ 1.0 1,000 1

Planning time: 20.056 msLimit (cost=16,284.13..16,286.63 rows=1,000 width=685) (actual time=276.379..277.682 rows=1,000 loops=1)

2. 15.248 276.929 ↑ 3.7 1,000 1

Sort (cost=16,284.13..16,293.47 rows=3,738 width=685) (actual time=276.377..276.929 rows=1,000 loops=1)

  • Sort Method: top-N heapsort Memory: 564kB
  • Sort Key: cv.id
3. 12.635 261.681 ↓ 2.9 10,925 1

Hash Left Join (cost=15,978.43..16,079.18 rows=3,738 width=685) (actual time=236.641..261.681 rows=10,925 loops=1)

  • Hash Cond: (pa.t_produto_id = p.id)
4. 248.987 248.987 ↓ 2.9 10,925 1

Hash Right Join (cost=15,974.86..16,005.53 rows=3,738 width=662) (actual time=236.559..248.987 rows=10,925 loops=1)

5. 0.000 0.059 ↑ 2.2 52 1

Hash (cost=2.14..2.14 rows=114 width=31) (actual time=0.059..0.059 rows=52 loops=1)

  • Hash Cond: (x.t_cv_adq_id = cv.id)
  • Buckets: 1,024 Batches: 1 Memory Usage: 12kB
6. 0.032 0.032 ↑ 2.2 52 1

Seq Scan on t_produto p (cost=0.00..2.14 rows=114 width=31) (actual time=0.006..0.032 rows=52 loops=1)

7. 2.452 2.452 ↑ 1.0 791 1

HashAggregate (cost=49.89..69.67 rows=791 width=26) (actual time=1.730..2.452 rows=791 loops=1)

8. 16.289 234.483 ↓ 2.9 10,925 1

Hash (cost=15,878.24..15,878.24 rows=3,738 width=550) (actual time=234.483..234.483 rows=10,925 loops=1)

  • Group Key: x.t_cv_adq_id
  • Buckets: 16,384 (originally 4096) Batches: 1 (originally 1) Memory Usage: 5,026kB
9. 0.511 0.511 ↑ 1.0 797 1

Seq Scan on t_estorno_adq x (cost=0.00..31.96 rows=797 width=26) (actual time=0.009..0.511 rows=797 loops=1)

10. 12.101 217.683 ↓ 2.9 10,925 1

Hash Left Join (cost=82.92..15,878.24 rows=3,738 width=550) (actual time=2.597..217.683 rows=10,925 loops=1)

  • Hash Cond: (ro.t_produto_adq_id = pa.id)
  • Filter: ((fl_conc_estorno)::text <> ALL ('{X,EXCLUIDO}'::text[]))
11. 205.458 205.458 ↓ 2.9 10,925 1

Hash Left Join (cost=79.02..15,829.62 rows=3,738 width=550) (actual time=2.460..205.458 rows=10,925 loops=1)

12. 0.000 0.124 ↑ 1.0 129 1

Hash (cost=2.29..2.29 rows=129 width=8) (actual time=0.124..0.124 rows=129 loops=1)

  • Hash Cond: ((est.id = pdv.t_estab_adq_id) AND (ltrim((ro.nu_logico_terminal)::text, '0'::text) = ltrim((pdv.numero)::text, '0'::text)))
  • Buckets: 1,024 Batches: 1 Memory Usage: 14kB
13. 0.064 0.064 ↑ 1.0 129 1

Seq Scan on t_produto_adq pa (cost=0.00..2.29 rows=129 width=8) (actual time=0.002..0.064 rows=129 loops=1)

14. 187.693 187.693 ↓ 2.9 10,745 1

Hash Left Join (cost=52.21..15,709.16 rows=3,738 width=554) (actual time=1.487..187.693 rows=10,745 loops=1)

15. 0.000 0.961 ↓ 1.0 854 1

Hash (cost=14.32..14.32 rows=832 width=14) (actual time=0.961..0.961 rows=854 loops=1)

  • Hash Cond: (dbc.t_banco_id = bc.id)
  • Buckets: 1,024 Batches: 1 Memory Usage: 47kB
16. 0.395 0.395 ↓ 1.0 854 1

Seq Scan on t_pdv pdv (cost=0.00..14.32 rows=832 width=14) (actual time=0.002..0.395 rows=854 loops=1)

17. 176.155 176.155 ↓ 2.9 10,745 1

Hash Left Join (cost=51.06..15,656.61 rows=3,738 width=531) (actual time=1.464..176.155 rows=10,745 loops=1)

18. 0.000 0.013 ↑ 1.0 7 1

Hash (cost=1.07..1.07 rows=7 width=31) (actual time=0.013..0.013 rows=7 loops=1)

  • Hash Cond: (ro.t_domc_bancario_id = dbc.id)
  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
19. 0.005 0.005 ↑ 1.0 7 1

Seq Scan on t_banco bc (cost=0.00..1.07 rows=7 width=31) (actual time=0.002..0.005 rows=7 loops=1)

20. 164.262 164.262 ↓ 2.9 10,745 1

Hash Join (cost=49.83..15,609.28 rows=3,738 width=511) (actual time=1.435..164.262 rows=10,745 loops=1)

21. 0.000 0.017 ↑ 1.0 10 1

Hash (cost=1.10..1.10 rows=10 width=20) (actual time=0.017..0.017 rows=10 loops=1)

  • Hash Cond: (mdl.t_tp_band_id = tpband.id)
  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
22. 0.005 0.005 ↑ 1.0 10 1

Seq Scan on t_domc_bancario dbc (cost=0.00..1.10 rows=10 width=20) (actual time=0.002..0.005 rows=10 loops=1)

23. 153.034 153.034 ↓ 2.5 10,745 1

Hash Join (cost=48.70..15,554.41 rows=4,361 width=498) (actual time=1.407..153.034 rows=10,745 loops=1)

24. 0.000 0.014 ↑ 1.0 6 1

Hash (cost=1.06..1.06 rows=6 width=17) (actual time=0.014..0.014 rows=6 loops=1)

  • Hash Cond: (bmb.t_modl_band_id = mdl.id)
  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
25. 0.010 0.010 ↑ 1.0 6 1

Seq Scan on t_tp_band tpband (cost=0.00..1.06 rows=6 width=17) (actual time=0.004..0.010 rows=6 loops=1)

26. 141.025 141.025 ↓ 2.5 10,745 1

Hash Join (cost=47.43..15,493.17 rows=4,361 width=460) (actual time=1.378..141.025 rows=10,745 loops=1)

27. 0.000 0.019 ↑ 1.0 12 1

Hash (cost=1.12..1.12 rows=12 width=42) (actual time=0.019..0.019 rows=12 loops=1)

  • Hash Cond: (bmb.t_band_id = band.id)
  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
28. 0.005 0.005 ↑ 1.0 12 1

Seq Scan on t_modl_band mdl (cost=0.00..1.12 rows=12 width=42) (actual time=0.002..0.005 rows=12 loops=1)

29. 129.802 129.802 ↓ 2.2 10,745 1

Hash Join (cost=45.93..15,429.48 rows=4,956 width=432) (actual time=1.342..129.802 rows=10,745 loops=1)

30. 0.000 0.027 ↑ 1.0 22 1

Hash (cost=1.22..1.22 rows=22 width=32) (actual time=0.027..0.027 rows=22 loops=1)

  • Hash Cond: (abm.t_band_modl_band_id = bmb.id)
  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
31. 0.004 0.004 ↑ 1.0 22 1

Seq Scan on t_band band (cost=0.00..1.22 rows=22 width=32) (actual time=0.002..0.004 rows=22 loops=1)

32. 118.095 118.095 ↓ 2.2 10,745 1

Hash Join (cost=43.04..15,358.45 rows=4,956 width=428) (actual time=1.250..118.095 rows=10,745 loops=1)

33. 0.000 0.082 ↑ 1.0 84 1

Hash (cost=1.84..1.84 rows=84 width=12) (actual time=0.082..0.082 rows=84 loops=1)

  • Hash Cond: (abm.t_adq_id = adq.id)
  • Buckets: 1,024 Batches: 1 Memory Usage: 12kB
34. 0.040 0.040 ↑ 1.0 84 1

Seq Scan on t_band_modl_band bmb (cost=0.00..1.84 rows=84 width=12) (actual time=0.002..0.040 rows=84 loops=1)

35. 106.462 106.462 ↓ 2.2 10,745 1

Hash Join (cost=41.77..15,289.03 rows=4,956 width=400) (actual time=1.222..106.462 rows=10,745 loops=1)

36. 0.000 0.019 ↑ 1.0 12 1

Hash (cost=1.12..1.12 rows=12 width=32) (actual time=0.019..0.019 rows=12 loops=1)

  • Hash Cond: (ro.t_adq_band_modl_id = abm.id)
  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
37. 0.008 0.008 ↑ 1.0 12 1

Seq Scan on t_adq adq (cost=0.00..1.12 rows=12 width=32) (actual time=0.004..0.008 rows=12 loops=1)

38. 94.803 94.803 ↓ 2.2 10,745 1

Hash Join (cost=28.34..15,207.45 rows=4,956 width=392) (actual time=0.919..94.803 rows=10,745 loops=1)

39. 0.000 0.293 ↑ 1.0 286 1

Hash (cost=9.86..9.86 rows=286 width=12) (actual time=0.293..0.293 rows=286 loops=1)

  • Hash Cond: (ro.t_estab_adq_id = est.id)
  • Buckets: 1,024 Batches: 1 Memory Usage: 21kB
40. 0.151 0.151 ↑ 1.0 286 1

Seq Scan on t_adq_band_modl abm (cost=0.00..9.86 rows=286 width=12) (actual time=0.004..0.151 rows=286 loops=1)

41. 82.662 82.662 ↓ 2.2 10,745 1

Hash Join (cost=4.30..15,115.28 rows=4,956 width=379) (actual time=0.124..82.662 rows=10,745 loops=1)

42. 0.000 0.780 ↓ 1.0 766 1

Hash (cost=14.57..14.57 rows=757 width=13) (actual time=0.780..0.780 rows=766 loops=1)

  • Hash Cond: (tp.t_tp_captura_id = cap.id)
  • Buckets: 1,024 Batches: 1 Memory Usage: 43kB
43. 0.404 0.404 ↓ 1.0 766 1

Seq Scan on t_estab_adq est (cost=0.00..14.57 rows=757 width=13) (actual time=0.002..0.404 rows=766 loops=1)

44. 71.670 71.670 ↓ 1.9 10,745 1

Hash Join (cost=3.01..15,042.98 rows=5,719 width=364) (actual time=0.089..71.670 rows=10,745 loops=1)

45. 0.000 0.024 ↓ 1.5 19 1

Hash (cost=1.13..1.13 rows=13 width=19) (actual time=0.024..0.024 rows=19 loops=1)

  • Hash Cond: (ro.t_tp_captura_adq_id = tp.id)
  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
46. 0.007 0.007 ↓ 1.5 19 1

Seq Scan on t_tp_captura cap (cost=0.00..1.13 rows=13 width=19) (actual time=0.002..0.007 rows=19 loops=1)

47. 60.232 60.232 ↓ 1.9 10,745 1

Nested Loop (cost=0.86..14,962.19 rows=5,719 width=364) (actual time=0.023..60.232 rows=10,745 loops=1)

48. 0.000 0.056 ↓ 1.1 54 1

Hash (cost=1.51..1.51 rows=51 width=8) (actual time=0.056..0.056 rows=54 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
49. 0.026 0.026 ↓ 1.1 54 1

Seq Scan on t_tp_captura_adq tp (cost=0.00..1.51 rows=51 width=8) (actual time=0.003..0.026 rows=54 loops=1)

50. 21.490 21.490 ↑ 1.0 1 10,745

Index Scan using t_ro_adq_pkey on t_ro_adq ro (cost=0.43..2.44 rows=1 width=94) (actual time=0.002..0.002 rows=1 loops=10,745)

51. 7.675 7.675 ↓ 1.9 10,745 1

Index Scan using t_cv_adq_dt_venda_aj_id1 on t_cv_adq cv (cost=0.43..976.15 rows=5,719 width=274) (actual time=0.012..7.675 rows=10,745 loops=1)

  • Index Cond: (id = cv.t_ro_adq_id)
  • Index Cond: (dt_venda_aj = '2020-08-01 00:00:00'::timestamp without time zone)
Execution time : 278.663 ms