explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2F9w

Settings
# exclusive inclusive rows x rows loops node
1. 0.378 6,995.103 ↑ 1.0 500 1

Limit (cost=16,265.44..16,266.69 rows=500 width=685) (actual time=6,994.372..6,995.103 rows=500 loops=1)

2. 15.954 6,994.725 ↑ 7.5 500 1

Sort (cost=16,265.44..16,274.78 rows=3,738 width=685) (actual time=6,994.370..6,994.725 rows=500 loops=1)

  • Sort Key: cv.id
  • Sort Method: top-N heapsort Memory: 282kB
3. 13.977 6,978.771 ↓ 2.9 10,925 1

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

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

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

  • Hash Cond: (x.t_cv_adq_id = cv.id)
5. 2.429 54.309 ↑ 1.0 791 1

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

  • Group Key: x.t_cv_adq_id
6. 51.880 51.880 ↑ 1.0 797 1

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

  • Filter: ((fl_conc_estorno)::text <> ALL ('{X,EXCLUIDO}'::text[]))
7. 22.219 6,896.799 ↓ 2.9 10,925 1

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

  • Buckets: 16,384 (originally 4096) Batches: 1 (originally 1) Memory Usage: 5,026kB
8. 13.322 6,874.580 ↓ 2.9 10,925 1

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

  • Hash Cond: (ro.t_produto_adq_id = pa.id)
9. 21.320 6,861.133 ↓ 2.9 10,925 1

Hash Left Join (cost=79.02..15,829.62 rows=3,738 width=550) (actual time=2.510..6,861.133 rows=10,925 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)))
10. 12.950 6,838.805 ↓ 2.9 10,745 1

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

  • Hash Cond: (dbc.t_banco_id = bc.id)
11. 13.153 6,825.842 ↓ 2.9 10,745 1

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

  • Hash Cond: (ro.t_domc_bancario_id = dbc.id)
12. 12.570 6,812.672 ↓ 2.9 10,745 1

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

  • Hash Cond: (mdl.t_tp_band_id = tpband.id)
13. 13.372 6,800.090 ↓ 2.5 10,745 1

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

  • Hash Cond: (bmb.t_modl_band_id = mdl.id)
14. 13.065 6,786.689 ↓ 2.5 10,745 1

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

  • Hash Cond: (bmb.t_band_id = band.id)
15. 12.676 6,773.596 ↓ 2.2 10,745 1

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

  • Hash Cond: (abm.t_band_modl_band_id = bmb.id)
16. 12.695 6,760.824 ↓ 2.2 10,745 1

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

  • Hash Cond: (abm.t_adq_id = adq.id)
17. 13.017 6,748.109 ↓ 2.2 10,745 1

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

  • Hash Cond: (ro.t_adq_band_modl_id = abm.id)
18. 12.908 6,734.788 ↓ 2.2 10,745 1

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

  • Hash Cond: (ro.t_estab_adq_id = est.id)
19. 12.554 6,721.132 ↓ 2.2 10,745 1

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

  • Hash Cond: (tp.t_tp_captura_id = cap.id)
20. 13.680 6,708.553 ↓ 1.9 10,745 1

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

  • Hash Cond: (ro.t_tp_captura_adq_id = tp.id)
21. 31.653 6,694.818 ↓ 1.9 10,745 1

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

22. 6,308.580 6,308.580 ↓ 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.014..6,308.580 rows=10,745 loops=1)

  • Index Cond: (dt_venda_aj = '2020-08-01 00:00:00'::timestamp without time zone)
23. 354.585 354.585 ↑ 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.032..0.033 rows=1 loops=10,745)

  • Index Cond: (id = cv.t_ro_adq_id)
24. 0.031 0.055 ↓ 1.1 54 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 11kB
25. 0.024 0.024 ↓ 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.024 rows=54 loops=1)

26. 0.018 0.025 ↓ 1.5 19 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
27. 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)

28. 0.384 0.748 ↓ 1.0 766 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 43kB
29. 0.364 0.364 ↓ 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.364 rows=766 loops=1)

30. 0.164 0.304 ↑ 1.0 286 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 21kB
31. 0.140 0.140 ↑ 1.0 286 1

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

32. 0.007 0.020 ↑ 1.0 12 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
33. 0.013 0.013 ↑ 1.0 12 1

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

34. 0.051 0.096 ↑ 1.0 84 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 12kB
35. 0.045 0.045 ↑ 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.045 rows=84 loops=1)

36. 0.016 0.028 ↑ 1.0 22 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
37. 0.012 0.012 ↑ 1.0 22 1

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

38. 0.019 0.029 ↑ 1.0 12 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
39. 0.010 0.010 ↑ 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.010 rows=12 loops=1)

40. 0.005 0.012 ↑ 1.0 6 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
41. 0.007 0.007 ↑ 1.0 6 1

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

42. 0.011 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)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
43. 0.006 0.006 ↑ 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.006 rows=10 loops=1)

44. 0.006 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)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
45. 0.007 0.007 ↑ 1.0 7 1

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

46. 0.599 1.008 ↓ 1.0 854 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 47kB
47. 0.409 0.409 ↓ 1.0 854 1

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

48. 0.062 0.125 ↑ 1.0 129 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 14kB
49. 0.063 0.063 ↑ 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.063 rows=129 loops=1)

50. 0.035 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)

  • Buckets: 1,024 Batches: 1 Memory Usage: 12kB
51. 0.024 0.024 ↑ 2.2 52 1

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

Planning time : 19.229 ms
Execution time : 6,995.772 ms