explain.depesz.com

PostgreSQL's explain analyze made readable

Result: CUEp

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

Limit (cost=236,452.93..281,562.82 rows=50 width=611) (actual time=1,155.414..1,156.121 rows=50 loops=1)

2. 0.026 1,156.117 ↑ 4.0 50 1

Unique (cost=236,452.93..416,892.50 rows=200 width=611) (actual time=1,155.413..1,156.117 rows=50 loops=1)

3. 0.501 1,156.091 ↑ 2,788.2 50 1

Nested Loop Left Join (cost=236,452.93..416,543.97 rows=139,411 width=611) (actual time=1,155.411..1,156.091 rows=50 loops=1)

4. 0.000 1,155.590 ↑ 2,788.2 50 1

Nested Loop Left Join (cost=236,452.79..359,000.90 rows=139,411 width=491) (actual time=1,155.221..1,155.590 rows=50 loops=1)

5. 0.035 1,155.541 ↑ 2,788.2 50 1

Nested Loop Left Join (cost=236,452.65..337,390.70 rows=139,411 width=413) (actual time=1,155.217..1,155.541 rows=50 loops=1)

6. 0.006 1,155.506 ↑ 2,788.2 50 1

Nested Loop Left Join (cost=236,452.51..314,349.49 rows=139,411 width=295) (actual time=1,155.202..1,155.506 rows=50 loops=1)

7. 0.032 1,155.450 ↑ 2,788.2 50 1

Merge Left Join (cost=236,452.36..291,344.16 rows=139,411 width=173) (actual time=1,155.194..1,155.450 rows=50 loops=1)

  • Merge Cond: ("*SELECT* 1".codigo = cr_fat.contasareceber_codigo)
8. 0.042 1,155.251 ↑ 2,788.2 50 1

Merge Left Join (cost=236,451.93..242,643.31 rows=139,411 width=161) (actual time=1,155.162..1,155.251 rows=50 loops=1)

  • Merge Cond: ("*SELECT* 1".codigo = cr_sit.contasareceber_codigo)
9. 51.148 967.419 ↑ 2,788.2 50 1

Sort (cost=132,858.38..133,206.91 rows=139,411 width=157) (actual time=967.409..967.419 rows=50 loops=1)

  • Sort Key: "*SELECT* 1".codigo
  • Sort Method: external merge Disk: 16,264kB
10. 22.263 916.271 ↑ 1.2 117,970 1

Hash Left Join (cost=64,656.78..109,984.42 rows=139,411 width=157) (actual time=466.604..916.271 rows=117,970 loops=1)

  • Hash Cond: ("*SELECT* 1".vendedores_codigo = vend.codigo)
11. 6.668 893.964 ↑ 1.2 117,970 1

Append (cost=64,653.91..109,607.84 rows=139,411 width=148) (actual time=466.539..893.964 rows=117,970 loops=1)

12. 13.880 875.820 ↑ 1.2 117,956 1

Subquery Scan on *SELECT* 1 (cost=64,653.91..104,733.92 rows=139,022 width=148) (actual time=466.538..875.820 rows=117,956 loops=1)

13. 260.805 861.940 ↑ 1.2 117,956 1

Hash Join (cost=64,653.91..103,343.70 rows=139,022 width=148) (actual time=466.537..861.940 rows=117,956 loops=1)

  • Hash Cond: (cr.codigo = pvpg_cr.contasareceber_codigo)
14. 134.740 134.740 ↓ 1.0 820,043 1

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

15. 24.829 466.395 ↑ 1.2 117,956 1

Hash (cost=61,558.13..61,558.13 rows=139,022 width=50) (actual time=466.395..466.395 rows=117,956 loops=1)

  • Buckets: 65,536 Batches: 4 Memory Usage: 2,753kB
16. 143.797 441.566 ↑ 1.2 117,956 1

Hash Join (cost=38,098.92..61,558.13 rows=139,022 width=50) (actual time=249.772..441.566 rows=117,956 loops=1)

  • Hash Cond: (pvpg_cr.prevendas_pagtos_codigo = pvpg.codigo)
17. 48.078 48.078 ↑ 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.005..48.078 rows=820,000 loops=1)

18. 8.677 249.691 ↑ 2.3 37,682 1

Hash (cost=36,266.51..36,266.51 rows=86,033 width=46) (actual time=249.691..249.691 rows=37,682 loops=1)

  • Buckets: 65,536 Batches: 2 Memory Usage: 1,875kB
19. 83.051 241.014 ↑ 2.3 37,682 1

Hash Join (cost=20,503.66..36,266.51 rows=86,033 width=46) (actual time=114.830..241.014 rows=37,682 loops=1)

  • Hash Cond: (pvpg.codprevenda = pv.codigo)
20. 43.208 43.208 ↑ 1.0 507,455 1

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

21. 7.464 114.755 ↑ 2.4 34,092 1

Hash (cost=18,759.91..18,759.91 rows=81,900 width=42) (actual time=114.755..114.755 rows=34,092 loops=1)

  • Buckets: 65,536 Batches: 2 Memory Usage: 1,682kB
22. 48.098 107.291 ↑ 2.4 34,092 1

Hash Join (cost=1,176.76..18,759.91 rows=81,900 width=42) (actual time=12.102..107.291 rows=34,092 loops=1)

  • Hash Cond: (pv.codcliente = cli.codigo)
23. 47.105 47.105 ↑ 1.0 483,072 1

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

24. 0.424 12.088 ↑ 1.1 2,297 1

Hash (cost=1,145.78..1,145.78 rows=2,479 width=30) (actual time=12.088..12.088 rows=2,297 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 175kB
25. 11.664 11.664 ↑ 1.1 2,297 1

Seq Scan on clientes cli (cost=0.00..1,145.78 rows=2,479 width=30) (actual time=0.009..11.664 rows=2,297 loops=1)

  • Filter: ((nome)::text ~~* '%jose%'::text)
  • Rows Removed by Filter: 12,325
26. 0.003 0.407 ↓ 1.7 10 1

Subquery Scan on *SELECT* 2 (cost=1.55..379.85 rows=6 width=148) (actual time=0.104..0.407 rows=10 loops=1)

27. 0.010 0.404 ↓ 1.7 10 1

Nested Loop (cost=1.55..379.79 rows=6 width=148) (actual time=0.103..0.404 rows=10 loops=1)

28. 0.006 0.364 ↓ 1.7 10 1

Nested Loop (cost=1.13..329.13 rows=6 width=50) (actual time=0.081..0.364 rows=10 loops=1)

29. 0.031 0.253 ↑ 1.0 35 1

Nested Loop (cost=0.84..317.95 rows=35 width=24) (actual time=0.055..0.253 rows=35 loops=1)

30. 0.036 0.152 ↑ 1.0 35 1

Nested Loop (cost=0.42..296.75 rows=35 width=12) (actual time=0.047..0.152 rows=35 loops=1)

31. 0.011 0.011 ↑ 1.0 35 1

Seq Scan on saidasnf_pagtos_contasareceber snfpg_cr (cost=0.00..1.35 rows=35 width=8) (actual time=0.008..0.011 rows=35 loops=1)

32. 0.105 0.105 ↑ 1.0 1 35

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

  • Index Cond: (codigo = snfpg_cr.saidasnf_pagtos_codigo)
33. 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=16) (actual time=0.002..0.002 rows=1 loops=35)

  • Index Cond: (codigo = snfpg.codsaidasnf)
34. 0.105 0.105 ↓ 0.0 0 35

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

  • Index Cond: (codigo = snf.codcliente)
  • Filter: ((nome)::text ~~* '%jose%'::text)
  • Rows Removed by Filter: 1
35. 0.030 0.030 ↑ 1.0 1 10

Index Scan using contasareceber_pkey1 on contasareceber cr_1 (cost=0.42..8.44 rows=1 width=49) (actual time=0.003..0.003 rows=1 loops=10)

  • Index Cond: (codigo = snfpg_cr.contasareceber_codigo)
36. 0.001 11.069 ↑ 95.8 4 1

Subquery Scan on *SELECT* 3 (cost=1,179.61..3,797.01 rows=383 width=148) (actual time=11.065..11.069 rows=4 loops=1)

37. 0.002 11.068 ↑ 95.8 4 1

Nested Loop Left Join (cost=1,179.61..3,793.18 rows=383 width=148) (actual time=11.064..11.068 rows=4 loops=1)

38. 0.003 11.062 ↑ 86.5 4 1

Hash Left Join (cost=1,179.46..3,726.03 rows=346 width=91) (actual time=11.060..11.062 rows=4 loops=1)

  • Hash Cond: (crav.codigo = cat.contasareceber_avulsas_codigo)
39. 0.006 11.055 ↑ 173.0 2 1

Hash Left Join (cost=1,178.39..3,723.66 rows=346 width=87) (actual time=11.053..11.055 rows=2 loops=1)

  • Hash Cond: (crav.codigo = cav.contasareceber_avulsas_codigo)
40. 0.003 11.043 ↑ 346.0 1 1

Nested Loop (cost=1,177.19..3,721.14 rows=346 width=83) (actual time=11.042..11.043 rows=1 loops=1)

41. 0.022 11.034 ↑ 346.0 1 1

Hash Join (cost=1,176.76..1,212.52 rows=346 width=38) (actual time=11.034..11.034 rows=1 loops=1)

  • Hash Cond: (crav.clientes_codigo = cli_2.codigo)
42. 0.004 0.004 ↑ 255.0 8 1

Seq Scan on contasareceber_avulsas crav (cost=0.00..30.40 rows=2,040 width=12) (actual time=0.003..0.004 rows=8 loops=1)

43. 0.328 11.008 ↑ 1.1 2,297 1

Hash (cost=1,145.78..1,145.78 rows=2,479 width=30) (actual time=11.008..11.008 rows=2,297 loops=1)

  • Buckets: 4,096 Batches: 1 Memory Usage: 175kB
44. 10.680 10.680 ↑ 1.1 2,297 1

Seq Scan on clientes cli_2 (cost=0.00..1,145.78 rows=2,479 width=30) (actual time=0.008..10.680 rows=2,297 loops=1)

  • Filter: ((nome)::text ~~* '%jose%'::text)
  • Rows Removed by Filter: 12,325
45. 0.006 0.006 ↑ 1.0 1 1

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

  • Index Cond: (codigo = crav.contasareceber_codigo)
46. 0.001 0.006 ↑ 1.0 9 1

Hash (cost=1.09..1.09 rows=9 width=8) (actual time=0.006..0.006 rows=9 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
47. 0.005 0.005 ↑ 1.0 9 1

Seq Scan on contasareceber_avulsas_vendedores cav (cost=0.00..1.09 rows=9 width=8) (actual time=0.004..0.005 rows=9 loops=1)

48. 0.001 0.004 ↑ 1.0 3 1

Hash (cost=1.03..1.03 rows=3 width=8) (actual time=0.004..0.004 rows=3 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 9kB
49. 0.003 0.003 ↑ 1.0 3 1

Seq Scan on contasareceber_avulsas_tecnicos cat (cost=0.00..1.03 rows=3 width=8) (actual time=0.003..0.003 rows=3 loops=1)

50. 0.004 0.004 ↓ 0.0 0 4

Index Scan using contasareceber_avulsas_contas_contasareceber_avulsas_codigo_key on contasareceber_avulsas_contasareceber_avulsas_lotes crav_lot (cost=0.15..0.19 rows=1 width=8) (actual time=0.001..0.001 rows=0 loops=4)

  • Index Cond: (crav.codigo = contasareceber_avulsas_codigo)
51. 0.005 0.044 ↑ 1.0 39 1

Hash (cost=2.39..2.39 rows=39 width=13) (actual time=0.044..0.044 rows=39 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
52. 0.039 0.039 ↑ 1.0 39 1

Seq Scan on vendedores vend (cost=0.00..2.39 rows=39 width=13) (actual time=0.020..0.039 rows=39 loops=1)

53. 142.542 187.790 ↑ 3,388.6 242 1

Sort (cost=103,593.55..105,643.66 rows=820,043 width=8) (actual time=187.748..187.790 rows=242 loops=1)

  • Sort Key: cr_sit.contasareceber_codigo
  • Sort Method: external merge Disk: 14,536kB
54. 45.248 45.248 ↑ 1.0 820,043 1

Seq Scan on contasareceber_situacao cr_sit (cost=0.00..11,829.43 rows=820,043 width=8) (actual time=0.009..45.248 rows=820,043 loops=1)

55. 0.167 0.167 ↑ 3,388.5 242 1

Index Scan using contasareceber_faturamentos_pkey on contasareceber_faturamentos cr_fat (cost=0.42..44,908.20 rows=820,006 width=12) (actual time=0.028..0.167 rows=242 loops=1)

56. 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)
57. 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)
58. 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)
59. 0.000 0.000 ↓ 0.0 0 50

Index Scan using tecnicos_pkey on tecnicos tec (cost=0.14..0.16 rows=1 width=122) (actual time=0.000..0.000 rows=0 loops=50)

  • Index Cond: (codigo = "*SELECT* 1".tecnicos_codigo)
Planning time : 4.770 ms
Execution time : 1,160.482 ms