explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 8550

Settings
# exclusive inclusive rows x rows loops node
1. 0.385 272.481 ↑ 1.0 500 1

Limit (cost=16,265.44..16,266.69 rows=500 width=685) (actual time=271.849..272.481 rows=500 loops=1)

2. 14.191 272.096 ↑ 7.5 500 1

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

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

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

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

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

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

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

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

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

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

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

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

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

  • Hash Cond: (ro.t_produto_adq_id = pa.id)
9. 16.622 203.023 ↓ 2.9 10,925 1

Hash Left Join (cost=79.02..15,829.62 rows=3,738 width=550) (actual time=2.420..203.023 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. 11.416 185.437 ↓ 2.9 10,745 1

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

  • Hash Cond: (dbc.t_banco_id = bc.id)
11. 11.629 174.009 ↓ 2.9 10,745 1

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

  • Hash Cond: (ro.t_domc_bancario_id = dbc.id)
12. 11.032 162.363 ↓ 2.9 10,745 1

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

  • Hash Cond: (mdl.t_tp_band_id = tpband.id)
13. 11.625 151.317 ↓ 2.5 10,745 1

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

  • Hash Cond: (bmb.t_modl_band_id = mdl.id)
14. 11.227 139.672 ↓ 2.5 10,745 1

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

  • Hash Cond: (bmb.t_band_id = band.id)
15. 11.320 128.418 ↓ 2.2 10,745 1

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

  • Hash Cond: (abm.t_band_modl_band_id = bmb.id)
16. 11.332 117.011 ↓ 2.2 10,745 1

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

  • Hash Cond: (abm.t_adq_id = adq.id)
17. 11.261 105.660 ↓ 2.2 10,745 1

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

  • Hash Cond: (ro.t_adq_band_modl_id = abm.id)
18. 11.272 94.117 ↓ 2.2 10,745 1

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

  • Hash Cond: (ro.t_estab_adq_id = est.id)
19. 11.095 82.101 ↓ 2.2 10,745 1

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

  • Hash Cond: (tp.t_tp_captura_id = cap.id)
20. 11.722 70.983 ↓ 1.9 10,745 1

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

  • Hash Cond: (ro.t_tp_captura_adq_id = tp.id)
21. 30.203 59.206 ↓ 1.9 10,745 1

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

22. 7.513 7.513 ↓ 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.013..7.513 rows=10,745 loops=1)

  • Index Cond: (dt_venda_aj = '2020-08-01 00:00:00'::timestamp without time zone)
23. 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)

  • Index Cond: (id = cv.t_ro_adq_id)
24. 0.029 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.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)

26. 0.010 0.023 ↓ 1.5 19 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
27. 0.013 0.013 ↓ 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.013 rows=19 loops=1)

28. 0.389 0.744 ↓ 1.0 766 1

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

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

30. 0.137 0.282 ↑ 1.0 286 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 21kB
31. 0.145 0.145 ↑ 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.145 rows=286 loops=1)

32. 0.013 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)

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

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

34. 0.051 0.087 ↑ 1.0 84 1

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

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

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

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

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

38. 0.016 0.020 ↑ 1.0 12 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
39. 0.004 0.004 ↑ 1.0 12 1

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

40. 0.009 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)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
41. 0.005 0.005 ↑ 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.005 rows=6 loops=1)

42. 0.012 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.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.001..0.005 rows=10 loops=1)

44. 0.007 0.012 ↑ 1.0 7 1

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

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
45. 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.001..0.005 rows=7 loops=1)

46. 0.573 0.964 ↓ 1.0 854 1

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

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

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

48. 0.063 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.062 0.062 ↑ 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.062 rows=129 loops=1)

50. 0.026 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.033 0.033 ↑ 2.2 52 1

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

Planning time : 18.844 ms
Execution time : 273.247 ms