explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mqov

Settings
# exclusive inclusive rows x rows loops node
1. 0.006 589.787 ↑ 1.0 50 1

Limit (cost=77,354.62..77,422.38 rows=50 width=476) (actual time=588.035..589.787 rows=50 loops=1)

2. 0.563 589.781 ↑ 16,166.7 50 1

Hash Left Join (cost=77,354.62..1,172,899.90 rows=808,337 width=476) (actual time=588.034..589.781 rows=50 loops=1)

  • Hash Cond: ("*SELECT* 1".tipodocumento_codigo = t.codigo)
3. 0.015 589.210 ↑ 16,166.7 50 1

Hash Left Join (cost=77,353.15..966,626.48 rows=808,337 width=396) (actual time=587.842..589.210 rows=50 loops=1)

  • Hash Cond: ("*SELECT* 1".gruposcontas_codigo = grct.codigo)
4. 0.023 589.194 ↑ 16,166.7 50 1

Hash Left Join (cost=77,333.25..964,464.26 rows=808,337 width=278) (actual time=587.837..589.194 rows=50 loops=1)

  • Hash Cond: (cr_sit.situacoesconta_codigo = sc.codigo)
5. 0.024 589.164 ↑ 16,166.7 50 1

Nested Loop Left Join (cost=77,313.57..962,301.78 rows=808,337 width=156) (actual time=587.824..589.164 rows=50 loops=1)

6. 0.052 588.990 ↑ 16,166.7 50 1

Nested Loop Left Join (cost=77,313.15..578,272.71 rows=808,337 width=152) (actual time=587.817..588.990 rows=50 loops=1)

7. 0.006 588.838 ↑ 16,166.7 50 1

Append (cost=77,312.72..187,975.65 rows=808,337 width=140) (actual time=587.805..588.838 rows=50 loops=1)

8. 0.009 588.832 ↑ 16,078.1 50 1

Subquery Scan on *SELECT* 1 (cost=77,312.72..140,094.45 rows=803,905 width=140) (actual time=587.804..588.832 rows=50 loops=1)

9. 0.033 588.823 ↑ 16,078.1 50 1

Hash Join (cost=77,312.72..132,055.40 rows=803,905 width=140) (actual time=587.803..588.823 rows=50 loops=1)

  • Hash Cond: (pv.codcliente = c.codigo)
10. 0.135 572.370 ↑ 16,078.4 51 1

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

  • Hash Cond: (pvpg_cr.contasareceber_codigo = cr.codigo)
11. 0.199 231.256 ↑ 13,898.3 59 1

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

  • Hash Cond: (pvpg.codprevenda = pv.codigo)
12. 0.616 106.418 ↑ 1,744.7 470 1

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

  • Hash Cond: (pvpg_cr.prevendas_pagtos_codigo = pvpg.codigo)
13. 0.241 0.241 ↑ 208.9 3,926 1

Seq Scan on prevendas_pagtos_contasareceber pvpg_cr (cost=0.00..11,829.00 rows=820,000 width=8) (actual time=0.007..0.241 rows=3,926 loops=1)

14. 60.682 105.561 ↓ 1.0 507,455 1

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

  • Buckets: 131072 Batches: 8 Memory Usage: 3498kB
15. 44.879 44.879 ↓ 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..44.879 rows=507,455 loops=1)

16. 59.517 124.639 ↑ 1.0 483,072 1

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

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

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

18. 190.934 340.979 ↑ 1.0 820,042 1

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

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

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

20. 2.861 16.420 ↓ 1.0 14,493 1

Hash (cost=1,145.78..1,145.78 rows=14,335 width=30) (actual time=16.419..16.420 rows=14,493 loops=1)

  • Buckets: 16384 Batches: 1 Memory Usage: 1029kB
21. 13.559 13.559 ↓ 1.0 14,493 1

Seq Scan on clientes c (cost=0.00..1,145.78 rows=14,335 width=30) (actual time=0.008..13.559 rows=14,493 loops=1)

  • Filter: ((nome)::text ~~* '%a%'::text)
  • Rows Removed by Filter: 129
22. 0.000 0.000 ↓ 0.0 0

Subquery Scan on *SELECT* 2 (cost=1.55..27,889.84 rows=2,216 width=140) (never executed)

23. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.55..27,867.68 rows=2,216 width=140) (never executed)

24. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1.13..12,034.01 rows=2,216 width=42) (never executed)

25. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.84..11,311.68 rows=2,260 width=16) (never executed)

26. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=0.42..9,943.00 rows=2,260 width=12) (never executed)

27. 0.000 0.000 ↓ 0.0 0

Seq Scan on saidasnf_pagtos_contasareceber snfpg_cr (cost=0.00..32.60 rows=2,260 width=8) (never executed)

28. 0.000 0.000 ↓ 0.0 0

Index Scan using saidasnf_pagto_pkey on saidasnf_pagto snfpg (cost=0.42..4.39 rows=1 width=8) (never executed)

  • Index Cond: (codigo = snfpg_cr.saidasnf_pagtos_codigo)
29. 0.000 0.000 ↓ 0.0 0

Index Scan using saidasnf_codigo_index on saidasnf snf (cost=0.42..0.61 rows=1 width=8) (never executed)

  • Index Cond: (codigo = snfpg.codsaidasnf)
30. 0.000 0.000 ↓ 0.0 0

Index Scan using unq_clientes on clientes c_1 (cost=0.29..0.32 rows=1 width=30) (never executed)

  • Index Cond: (codigo = snf.codcliente)
  • Filter: ((nome)::text ~~* '%a%'::text)
31. 0.000 0.000 ↓ 0.0 0

Index Scan using contasareceber_pkey1 on contasareceber cr_1 (cost=0.42..7.15 rows=1 width=49) (never executed)

  • Index Cond: (codigo = snfpg_cr.contasareceber_codigo)
32. 0.000 0.000 ↓ 0.0 0

Subquery Scan on *SELECT* 3 (cost=1,386.24..15,949.67 rows=2,216 width=140) (never executed)

33. 0.000 0.000 ↓ 0.0 0

Hash Left Join (cost=1,386.24..15,927.51 rows=2,216 width=140) (never executed)

  • Hash Cond: (crav.codigo = crav_lot.contasareceber_avulsas_codigo)
34. 0.000 0.000 ↓ 0.0 0

Nested Loop (cost=1,325.39..15,861.40 rows=2,000 width=83) (never executed)

35. 0.000 0.000 ↓ 0.0 0

Hash Join (cost=1,324.96..1,360.72 rows=2,000 width=38) (never executed)

  • Hash Cond: (crav.clientes_codigo = c_2.codigo)
36. 0.000 0.000 ↓ 0.0 0

Seq Scan on contasareceber_avulsas crav (cost=0.00..30.40 rows=2,040 width=12) (never executed)

37. 0.000 0.000 ↓ 0.0 0

Hash (cost=1,145.78..1,145.78 rows=14,335 width=30) (never executed)

38. 0.000 0.000 ↓ 0.0 0

Seq Scan on clientes c_2 (cost=0.00..1,145.78 rows=14,335 width=30) (never executed)

  • Filter: ((nome)::text ~~* '%a%'::text)
39. 0.000 0.000 ↓ 0.0 0

Index Scan using contasareceber_pkey1 on contasareceber cr_2 (cost=0.42..7.25 rows=1 width=49) (never executed)

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

Hash (cost=32.60..32.60 rows=2,260 width=8) (never executed)

41. 0.000 0.000 ↓ 0.0 0

Seq Scan on contasareceber_avulsas_contasareceber_avulsas_lotes crav_lot (cost=0.00..32.60 rows=2,260 width=8) (never executed)

42. 0.100 0.100 ↑ 1.0 1 50

Index Scan using contasareceber_faturamentos_pkey on contasareceber_faturamentos cr_fat (cost=0.42..0.48 rows=1 width=12) (actual time=0.002..0.002 rows=1 loops=50)

  • Index Cond: ("*SELECT* 1".codigo = contasareceber_codigo)
43. 0.150 0.150 ↑ 1.0 1 50

Index Scan using contasareceber_situacao_pkey on contasareceber_situacao cr_sit (cost=0.42..0.48 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=50)

  • Index Cond: ("*SELECT* 1".codigo = contasareceber_codigo)
44. 0.002 0.007 ↑ 71.7 6 1

Hash (cost=14.30..14.30 rows=430 width=126) (actual time=0.007..0.007 rows=6 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
45. 0.005 0.005 ↑ 71.7 6 1

Seq Scan on situacoescontas sc (cost=0.00..14.30 rows=430 width=126) (actual time=0.004..0.005 rows=6 loops=1)

46. 0.000 0.001 ↓ 0.0 0 1

Hash (cost=14.40..14.40 rows=440 width=122) (actual time=0.001..0.001 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
47. 0.001 0.001 ↓ 0.0 0 1

Seq Scan on gruposcontas grct (cost=0.00..14.40 rows=440 width=122) (actual time=0.001..0.001 rows=0 loops=1)

48. 0.003 0.008 ↓ 1.0 22 1

Hash (cost=1.21..1.21 rows=21 width=82) (actual time=0.008..0.008 rows=22 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
49. 0.005 0.005 ↓ 1.0 22 1

Seq Scan on tipodocumento t (cost=0.00..1.21 rows=21 width=82) (actual time=0.003..0.005 rows=22 loops=1)

Planning time : 3.310 ms
Execution time : 605.170 ms