explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rqST

Settings
# exclusive inclusive rows x rows loops node
1. 0.781 300.280 ↑ 1.0 1,000 1

Limit (cost=16,284.13..16,286.63 rows=1,000 width=685) (actual time=299.036..300.280 rows=1,000 loops=1)

2. 15.435 299.499 ↑ 3.7 1,000 1

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

  • Index Cond: (id = cv.t_ro_adq_id)
24. 0.028 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.027 0.027 ↓ 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.027 rows=54 loops=1)

26. 0.020 0.027 ↓ 1.5 19 1

Hash (cost=1.13..1.13 rows=13 width=19) (actual time=0.027..0.027 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.003..0.007 rows=19 loops=1)

28. 0.436 0.837 ↓ 1.0 766 1

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

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

30. 0.242 0.466 ↑ 1.0 286 1

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

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

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

32. 0.041 0.057 ↑ 1.0 12 1

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

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

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

34. 0.049 0.094 ↑ 1.0 84 1

Hash (cost=1.84..1.84 rows=84 width=12) (actual time=0.094..0.094 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.014 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.014 0.014 ↑ 1.0 22 1

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

38. 0.022 0.028 ↑ 1.0 12 1

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

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

40. 0.008 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.004 0.004 ↑ 1.0 6 1

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

42. 0.008 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.009 0.009 ↑ 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.009 rows=10 loops=1)

44. 0.005 0.011 ↑ 1.0 7 1

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

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

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

46. 0.635 1.032 ↓ 1.0 854 1

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

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

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

48. 0.066 0.152 ↑ 1.0 129 1

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

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

50. 0.035 0.060 ↑ 2.2 52 1

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

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

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

Planning time : 22.201 ms
Execution time : 301.100 ms