explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jbo7

Settings
# exclusive inclusive rows x rows loops node
1. 0.004 2,864.510 ↑ 1.0 50 1

Limit (cost=496,219.63..665,609.95 rows=50 width=476) (actual time=2,863.972..2,864.510 rows=50 loops=1)

2. 0.039 2,864.506 ↑ 4.0 50 1

Unique (cost=496,219.63..1,173,780.93 rows=200 width=476) (actual time=2,863.971..2,864.506 rows=50 loops=1)

3. 0.454 2,864.467 ↑ 16,490.4 50 1

Nested Loop Left Join (cost=496,219.63..1,171,719.63 rows=824,520 width=476) (actual time=2,863.969..2,864.467 rows=50 loops=1)

4. 0.021 2,863.963 ↑ 16,490.4 50 1

Nested Loop Left Join (cost=496,219.49..835,777.63 rows=824,520 width=396) (actual time=2,863.799..2,863.963 rows=50 loops=1)

5. 0.005 2,863.942 ↑ 16,490.4 50 1

Nested Loop Left Join (cost=496,219.34..699,720.49 rows=824,520 width=278) (actual time=2,863.797..2,863.942 rows=50 loops=1)

6. 0.020 2,863.887 ↑ 16,490.4 50 1

Merge Left Join (cost=496,219.19..563,659.84 rows=824,520 width=156) (actual time=2,863.789..2,863.887 rows=50 loops=1)

  • Merge Cond: ("*SELECT* 1".codigo = cr_sit.contasareceber_codigo)
7. 0.030 2,863.820 ↑ 16,490.4 50 1

Merge Left Join (cost=496,218.77..512,686.60 rows=824,520 width=152) (actual time=2,863.775..2,863.820 rows=50 loops=1)

  • Merge Cond: ("*SELECT* 1".codigo = cr_fat.contasareceber_codigo)
8. 531.578 2,595.339 ↑ 16,490.4 50 1

Sort (cost=388,235.49..390,296.79 rows=824,520 width=140) (actual time=2,595.326..2,595.339 rows=50 loops=1)

  • Sort Key: "*SELECT* 1".codigo
  • Sort Method: external merge Disk: 101320kB
9. 38.962 2,063.761 ↑ 1.0 820,042 1

Append (cost=77,279.75..188,843.23 rows=824,520 width=140) (actual time=575.265..2,063.761 rows=820,042 loops=1)

10. 91.750 2,020.506 ↑ 1.0 820,000 1

Subquery Scan on *SELECT* 1 (cost=77,279.75..140,222.43 rows=820,000 width=140) (actual time=575.264..2,020.506 rows=820,000 loops=1)

11. 216.757 1,928.756 ↑ 1.0 820,000 1

Hash Join (cost=77,279.75..132,022.43 rows=820,000 width=140) (actual time=575.264..1,928.756 rows=820,000 loops=1)

  • Hash Cond: (pv.codcliente = c.codigo)
12. 482.529 1,707.567 ↑ 1.0 820,000 1

Hash Join (cost=75,987.76..128,577.31 rows=820,000 width=61) (actual time=570.822..1,707.567 rows=820,000 loops=1)

  • Hash Cond: (pvpg_cr.contasareceber_codigo = cr.codigo)
13. 313.712 884.965 ↑ 1.0 820,000 1

Hash Join (cost=40,879.81..75,299.86 rows=820,000 width=16) (actual time=230.720..884.965 rows=820,000 loops=1)

  • Hash Cond: (pvpg.codprevenda = pv.codigo)
14. 290.042 449.378 ↑ 1.0 820,000 1

Hash Join (cost=16,639.69..39,012.21 rows=820,000 width=12) (actual time=108.658..449.378 rows=820,000 loops=1)

  • Hash Cond: (pvpg_cr.prevendas_pagtos_codigo = pvpg.codigo)
15. 50.726 50.726 ↑ 1.0 820,000 1

Seq Scan on prevendas_pagtos_contasareceber pvpg_cr (cost=0.00..11,829.00 rows=820,000 width=8) (actual time=0.006..50.726 rows=820,000 loops=1)

16. 62.627 108.610 ↓ 1.0 507,455 1

Hash (cost=8,313.53..8,313.53 rows=507,453 width=8) (actual time=108.610..108.610 rows=507,455 loops=1)

  • Buckets: 131072 Batches: 8 Memory Usage: 3498kB
17. 45.983 45.983 ↓ 1.0 507,455 1

Seq Scan on prevenda_pagto pvpg (cost=0.00..8,313.53 rows=507,453 width=8) (actual time=0.004..45.983 rows=507,455 loops=1)

18. 58.667 121.875 ↑ 1.0 483,072 1

Hash (cost=16,314.72..16,314.72 rows=483,072 width=8) (actual time=121.875..121.875 rows=483,072 loops=1)

  • Buckets: 131072 Batches: 8 Memory Usage: 3385kB
19. 63.208 63.208 ↑ 1.0 483,072 1

Seq Scan on prevendas pv (cost=0.00..16,314.72 rows=483,072 width=8) (actual time=0.034..63.208 rows=483,072 loops=1)

20. 194.739 340.073 ↑ 1.0 820,042 1

Hash (cost=16,848.42..16,848.42 rows=820,042 width=49) (actual time=340.073..340.073 rows=820,042 loops=1)

  • Buckets: 65536 Batches: 32 Memory Usage: 2765kB
21. 145.334 145.334 ↑ 1.0 820,042 1

Seq Scan on contasareceber cr (cost=0.00..16,848.42 rows=820,042 width=49) (actual time=0.021..145.334 rows=820,042 loops=1)

22. 1.846 4.432 ↑ 1.0 14,622 1

Hash (cost=1,109.22..1,109.22 rows=14,622 width=30) (actual time=4.432..4.432 rows=14,622 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 1036kB
23. 2.586 2.586 ↑ 1.0 14,622 1

Seq Scan on clientes c (cost=0.00..1,109.22 rows=14,622 width=30) (actual time=0.005..2.586 rows=14,622 loops=1)

24. 0.006 0.308 ↑ 64.6 35 1

Subquery Scan on *SELECT* 2 (cost=1.56..28,199.01 rows=2,260 width=140) (actual time=0.044..0.308 rows=35 loops=1)

25. 0.026 0.302 ↑ 64.6 35 1

Nested Loop (cost=1.56..28,176.41 rows=2,260 width=140) (actual time=0.043..0.302 rows=35 loops=1)

26. 0.004 0.241 ↑ 64.6 35 1

Nested Loop (cost=1.27..27,459.73 rows=2,260 width=61) (actual time=0.036..0.241 rows=35 loops=1)

27. 0.002 0.167 ↑ 64.6 35 1

Nested Loop (cost=0.85..26,091.05 rows=2,260 width=57) (actual time=0.029..0.167 rows=35 loops=1)

28. 0.015 0.095 ↑ 64.6 35 1

Nested Loop (cost=0.42..16,180.65 rows=2,260 width=53) (actual time=0.022..0.095 rows=35 loops=1)

29. 0.010 0.010 ↑ 64.6 35 1

Seq Scan on saidasnf_pagtos_contasareceber snfpg_cr (cost=0.00..32.60 rows=2,260 width=8) (actual time=0.008..0.010 rows=35 loops=1)

30. 0.070 0.070 ↑ 1.0 1 35

Index Scan using contasareceber_pkey1 on contasareceber cr_1 (cost=0.42..7.15 rows=1 width=49) (actual time=0.002..0.002 rows=1 loops=35)

  • Index Cond: (codigo = snfpg_cr.contasareceber_codigo)
31. 0.070 0.070 ↑ 1.0 1 35

Index Scan using saidasnf_pagto_pkey on saidasnf_pagto snfpg (cost=0.42..4.39 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=35)

  • Index Cond: (codigo = snfpg_cr.saidasnf_pagtos_codigo)
32. 0.070 0.070 ↑ 1.0 1 35

Index Scan using saidasnf_codigo_index on saidasnf snf (cost=0.42..0.61 rows=1 width=8) (actual time=0.002..0.002 rows=1 loops=35)

  • Index Cond: (codigo = snfpg.codsaidasnf)
33. 0.035 0.035 ↑ 1.0 1 35

Index Scan using unq_clientes on clientes c_1 (cost=0.29..0.32 rows=1 width=30) (actual time=0.001..0.001 rows=1 loops=35)

  • Index Cond: (codigo = snf.codcliente)
34. 0.002 3.985 ↑ 322.9 7 1

Subquery Scan on *SELECT* 3 (cost=1,292.73..16,299.19 rows=2,260 width=140) (actual time=3.959..3.985 rows=7 loops=1)

35. 0.014 3.983 ↑ 322.9 7 1

Hash Join (cost=1,292.73..16,276.59 rows=2,260 width=140) (actual time=3.958..3.983 rows=7 loops=1)

  • Hash Cond: (crav.clientes_codigo = c_2.codigo)
36. 0.003 0.034 ↑ 322.9 7 1

Merge Left Join (cost=0.73..14,978.66 rows=2,260 width=61) (actual time=0.011..0.034 rows=7 loops=1)

  • Merge Cond: (crav.codigo = crav_lot.contasareceber_avulsas_codigo)
37. 0.009 0.029 ↑ 291.4 7 1

Nested Loop (cost=0.58..14,869.45 rows=2,040 width=57) (actual time=0.008..0.029 rows=7 loops=1)

38. 0.006 0.006 ↑ 291.4 7 1

Index Scan using contasareceber_avulsas_pkey on contasareceber_avulsas crav (cost=0.15..78.75 rows=2,040 width=12) (actual time=0.003..0.006 rows=7 loops=1)

39. 0.014 0.014 ↑ 1.0 1 7

Index Scan using contasareceber_pkey1 on contasareceber cr_2 (cost=0.42..7.25 rows=1 width=49) (actual time=0.002..0.002 rows=1 loops=7)

  • Index Cond: (codigo = crav.contasareceber_codigo)
40. 0.002 0.002 ↓ 0.0 0 1

Index Scan using contasareceber_avulsas_contas_contasareceber_avulsas_codigo_key on contasareceber_avulsas_contasareceber_avulsas_lotes crav_lot (cost=0.15..78.06 rows=2,260 width=8) (actual time=0.002..0.002 rows=0 loops=1)

41. 1.606 3.935 ↑ 1.0 14,622 1

Hash (cost=1,109.22..1,109.22 rows=14,622 width=30) (actual time=3.935..3.935 rows=14,622 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 1036kB
42. 2.329 2.329 ↑ 1.0 14,622 1

Seq Scan on clientes c_2 (cost=0.00..1,109.22 rows=14,622 width=30) (actual time=0.003..2.329 rows=14,622 loops=1)

43. 193.466 268.451 ↑ 16,400.1 50 1

Sort (cost=107,983.28..110,033.29 rows=820,006 width=12) (actual time=268.444..268.451 rows=50 loops=1)

  • Sort Key: cr_fat.contasareceber_codigo
  • Sort Method: external merge Disk: 20920kB
44. 74.985 74.985 ↓ 1.0 820,007 1

Seq Scan on contasareceber_faturamentos cr_fat (cost=0.00..13,423.06 rows=820,006 width=12) (actual time=0.021..74.985 rows=820,007 loops=1)

45. 0.047 0.047 ↑ 16,400.8 50 1

Index Scan using contasareceber_situacao_pkey on contasareceber_situacao cr_sit (cost=0.42..38,616.64 rows=820,041 width=8) (actual time=0.012..0.047 rows=50 loops=1)

46. 0.050 0.050 ↑ 1.0 1 50

Index Scan using situacoescontas_pkey on situacoescontas sc (cost=0.15..0.17 rows=1 width=126) (actual time=0.001..0.001 rows=1 loops=50)

  • Index Cond: (cr_sit.situacoesconta_codigo = codigo)
47. 0.000 0.000 ↓ 0.0 0 50

Index Scan using gruposcontas_pkey on gruposcontas grct (cost=0.15..0.17 rows=1 width=122) (actual time=0.000..0.000 rows=0 loops=50)

  • Index Cond: (codigo = "*SELECT* 1".gruposcontas_codigo)
48. 0.050 0.050 ↑ 1.0 1 50

Index Scan using tipodocumento_pkey on tipodocumento t (cost=0.14..0.16 rows=1 width=82) (actual time=0.001..0.001 rows=1 loops=50)

  • Index Cond: (codigo = "*SELECT* 1".tipodocumento_codigo)
Planning time : 2.005 ms
Execution time : 2,879.982 ms