explain.depesz.com

PostgreSQL's explain analyze made readable

Result: XP8R : Teste

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 28.661 2,304.272 ↓ 120.6 21,472 1

Hash Left Join (cost=48,450.68..57,767.45 rows=178 width=1,469) (actual time=1,558.484..2,304.272 rows=21,472 loops=1)

  • Hash Cond: (listadocum17_.conta_id = conta19_.id)
2. 28.840 2,275.526 ↓ 120.6 21,472 1

Hash Left Join (cost=48,449.19..57,763.51 rows=178 width=1,350) (actual time=1,558.390..2,275.526 rows=21,472 loops=1)

  • Hash Cond: (listadocum17_.formapagamento_id = formapagam18_.id)
3. 39.607 2,246.623 ↓ 120.6 21,472 1

Nested Loop Left Join (cost=48,447.31..57,759.28 rows=178 width=1,163) (actual time=1,558.313..2,246.623 rows=21,472 loops=1)

4. 27.633 2,207.016 ↓ 120.6 21,472 1

Hash Left Join (cost=48,447.02..56,789.42 rows=178 width=1,163) (actual time=1,558.305..2,207.016 rows=21,472 loops=1)

  • Hash Cond: (listapedid12_.voucher_id = voucher14_.id)
5. 26.877 2,178.593 ↓ 120.6 21,472 1

Hash Left Join (cost=48,420.63..56,762.34 rows=178 width=1,132) (actual time=1,557.505..2,178.593 rows=21,472 loops=1)

  • Hash Cond: (listapedid12_.formapagamento_id = formapagam13_.id)
6. 26.150 2,151.503 ↓ 120.6 21,472 1

Hash Left Join (cost=48,418.75..56,758.02 rows=178 width=894) (actual time=1,557.278..2,151.503 rows=21,472 loops=1)

  • Hash Cond: (pedidovend0_.id = listanotaf11_.pedidovenda_id)
7. 897.672 2,123.513 ↓ 120.6 21,472 1

Hash Right Join (cost=48,325.05..56,663.41 rows=178 width=884) (actual time=1,555.419..2,123.513 rows=21,472 loops=1)

  • Hash Cond: (listadocum17_.documentoorigem_id = listadocum16_.id)
8. 64.231 64.231 ↑ 1.0 80,770 1

Seq Scan on documento listadocum17_ (cost=0.00..8,033.70 rows=80,770 width=46) (actual time=0.141..64.231 rows=80,770 loops=1)

9. 41.664 1,161.610 ↓ 120.6 21,472 1

Hash (cost=48,322.82..48,322.82 rows=178 width=842) (actual time=1,161.610..1,161.610 rows=21,472 loops=1)

  • Buckets: 16384 (originally 1024) Batches: 1024 (originally 1) Memory Usage: 7886kB
10. 54.398 1,119.946 ↓ 120.6 21,472 1

Hash Right Join (cost=47,316.00..48,322.82 rows=178 width=842) (actual time=1,077.186..1,119.946 rows=21,472 loops=1)

  • Hash Cond: (listapedid12_.pedidovenda_id = pedidovend0_.id)
11. 5.969 5.969 ↑ 1.0 49,932 1

Seq Scan on pedidovendaformapagamento listapedid12_ (cost=0.00..819.32 rows=49,932 width=26) (actual time=0.019..5.969 rows=49,932 loops=1)

12. 41.596 1,059.579 ↓ 120.6 21,472 1

Hash (cost=47,313.77..47,313.77 rows=178 width=820) (actual time=1,059.579..1,059.579 rows=21,472 loops=1)

  • Buckets: 16384 (originally 1024) Batches: 2 (originally 1) Memory Usage: 4117kB
13. 57.422 1,017.983 ↓ 120.6 21,472 1

Hash Right Join (cost=46,257.01..47,313.77 rows=178 width=820) (actual time=972.468..1,017.983 rows=21,472 loops=1)

  • Hash Cond: (listadocum16_.pedidovenda_id = pedidovend0_.id)
14. 6.236 6.236 ↑ 1.0 55,234 1

Seq Scan on documentoorigem listadocum16_ (cost=0.00..849.34 rows=55,234 width=8) (actual time=0.025..6.236 rows=55,234 loops=1)

15. 46.818 954.325 ↓ 120.6 21,472 1

Hash (cost=46,254.79..46,254.79 rows=178 width=816) (actual time=954.325..954.325 rows=21,472 loops=1)

  • Buckets: 16384 (originally 1024) Batches: 2 (originally 1) Memory Usage: 4116kB
16. 14.475 907.507 ↓ 120.6 21,472 1

Hash Left Join (cost=37,877.05..46,254.79 rows=178 width=816) (actual time=727.551..907.507 rows=21,472 loops=1)

  • Hash Cond: (pedidovend0_.taxadelivery_id = taxadelive4_.id)
17. 18.781 893.026 ↓ 120.6 21,472 1

Hash Join (cost=37,862.33..46,239.39 rows=178 width=466) (actual time=727.530..893.026 rows=21,472 loops=1)

  • Hash Cond: (listapedid8_.produto_id = produto9_.id)
18. 183.956 874.159 ↓ 113.6 21,478 1

Hash Join (cost=37,858.19..46,232.76 rows=189 width=406) (actual time=727.439..874.159 rows=21,478 loops=1)

  • Hash Cond: (listapedid8_.pedidovenda_id = pedidovend0_.id)
19. 45.851 45.851 ↑ 1.0 341,795 1

Seq Scan on pedidovendaitem listapedid8_ (cost=0.00..7,090.95 rows=341,795 width=54) (actual time=0.006..45.851 rows=341,795 loops=1)

20. 30.687 644.352 ↓ 113.6 21,478 1

Hash (cost=37,855.83..37,855.83 rows=189 width=356) (actual time=644.352..644.352 rows=21,478 loops=1)

  • Buckets: 16384 (originally 1024) Batches: 2 (originally 1) Memory Usage: 3969kB
21. 124.835 613.665 ↓ 113.6 21,478 1

Hash Right Join (cost=34,018.09..37,855.83 rows=189 width=356) (actual time=571.097..613.665 rows=21,478 loops=1)

  • Hash Cond: (listanotaf10_.pedidovenda_id = pedidovend0_.id)
22. 14.617 14.617 ↑ 1.0 96,015 1

Seq Scan on notafiscalservico listanotaf10_ (cost=0.00..3,477.15 rows=96,015 width=15) (actual time=0.009..14.617 rows=96,015 loops=1)

23. 35.990 474.213 ↓ 113.6 21,478 1

Hash (cost=34,015.73..34,015.73 rows=189 width=345) (actual time=474.213..474.213 rows=21,478 loops=1)

  • Buckets: 16384 (originally 1024) Batches: 2 (originally 1) Memory Usage: 3969kB
24. 22.047 438.223 ↓ 113.6 21,478 1

Hash Join (cost=11,805.94..34,015.73 rows=189 width=345) (actual time=14.522..438.223 rows=21,478 loops=1)

  • Hash Cond: (usuario5_.pontoatendimento_id = pontoatend6_.id)
25. 29.992 414.968 ↓ 15.1 23,745 1

Nested Loop Left Join (cost=11,464.11..33,667.23 rows=1,574 width=256) (actual time=13.307..414.968 rows=23,745 loops=1)

26. 30.152 313.741 ↓ 15.1 23,745 1

Nested Loop Left Join (cost=11,463.69..32,846.10 rows=1,574 width=195) (actual time=13.300..313.741 rows=23,745 loops=1)

27. 10.777 212.354 ↓ 15.1 23,745 1

Hash Left Join (cost=11,463.26..24,913.80 rows=1,574 width=193) (actual time=13.292..212.354 rows=23,745 loops=1)

  • Hash Cond: (pedidovend0_.indicacao_id = contabilid2_.id)
28. 19.684 196.034 ↓ 15.1 23,745 1

Hash Join (cost=4,619.63..18,063.69 rows=1,574 width=120) (actual time=7.734..196.034 rows=23,745 loops=1)

  • Hash Cond: (pedidovend0_.vendedor_id = vendedor3_.id)
29. 168.763 168.763 ↓ 15.1 23,745 1

Seq Scan on pedidovenda pedidovend0_ (cost=0.00..13,422.41 rows=1,574 width=82) (actual time=0.128..168.763 rows=23,745 loops=1)

  • Filter: ((situacao = 1) AND (date(dataconfirmacao) >= '2019-10-01'::date) AND (date(dataconfirmacao) <= '2019-10-31'::date))
  • Rows Removed by Filter: 318051
30. 0.455 7.587 ↑ 1.0 645 1

Hash (cost=4,611.55..4,611.55 rows=647 width=46) (actual time=7.587..7.587 rows=645 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 56kB
31. 0.563 7.132 ↑ 1.0 645 1

Hash Join (cost=69.88..4,611.55 rows=647 width=46) (actual time=1.524..7.132 rows=645 loops=1)

  • Hash Cond: (vendedor3_1_.usuario_id = usuario5_.id)
32. 0.417 5.090 ↑ 1.0 647 1

Nested Loop (cost=0.42..4,539.62 rows=647 width=42) (actual time=0.020..5.090 rows=647 loops=1)

33. 0.144 0.144 ↑ 1.0 647 1

Seq Scan on vendedor vendedor3_ (cost=0.00..12.47 rows=647 width=4) (actual time=0.010..0.144 rows=647 loops=1)

34. 4.529 4.529 ↑ 1.0 1 647

Index Scan using pessoa_pkey on pessoa vendedor3_1_ (cost=0.42..6.99 rows=1 width=38) (actual time=0.006..0.007 rows=1 loops=647)

  • Index Cond: (id = vendedor3_.id)
35. 0.482 1.479 ↑ 1.0 1,576 1

Hash (cost=49.76..49.76 rows=1,576 width=8) (actual time=1.479..1.479 rows=1,576 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 74kB
36. 0.997 0.997 ↑ 1.0 1,576 1

Seq Scan on usuario usuario5_ (cost=0.00..49.76 rows=1,576 width=8) (actual time=0.009..0.997 rows=1,576 loops=1)

37. 0.613 5.543 ↑ 1.0 1,068 1

Hash (cost=6,830.28..6,830.28 rows=1,068 width=77) (actual time=5.543..5.543 rows=1,068 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 123kB
38. 0.510 4.930 ↑ 1.0 1,068 1

Nested Loop Left Join (cost=0.42..6,830.28 rows=1,068 width=77) (actual time=0.018..4.930 rows=1,068 loops=1)

39. 0.148 0.148 ↑ 1.0 1,068 1

Seq Scan on contabilidade contabilid2_ (cost=0.00..25.68 rows=1,068 width=16) (actual time=0.011..0.148 rows=1,068 loops=1)

40. 4.272 4.272 ↑ 1.0 1 1,068

Index Scan using pessoa_pkey on pessoa contabilid2_1_ (cost=0.42..6.36 rows=1 width=65) (actual time=0.004..0.004 rows=1 loops=1,068)

  • Index Cond: (contabilid2_.id = id)
41. 71.235 71.235 ↑ 1.0 1 23,745

Index Scan using cliente_pkey on cliente cliente1_ (cost=0.42..5.03 rows=1 width=6) (actual time=0.003..0.003 rows=1 loops=23,745)

  • Index Cond: (pedidovend0_.cliente_id = id)
42. 71.235 71.235 ↑ 1.0 1 23,745

Index Scan using pessoa_pkey on pessoa cliente1_1_ (cost=0.42..0.51 rows=1 width=65) (actual time=0.003..0.003 rows=1 loops=23,745)

  • Index Cond: (cliente1_.id = id)
43. 0.049 1.208 ↑ 1.0 43 1

Hash (cost=341.29..341.29 rows=43 width=93) (actual time=1.207..1.208 rows=43 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
44. 0.051 1.159 ↑ 1.0 43 1

Nested Loop Left Join (cost=20.98..341.29 rows=43 width=93) (actual time=0.258..1.159 rows=43 loops=1)

45. 0.054 0.807 ↑ 1.0 43 1

Hash Left Join (cost=20.56..40.41 rows=43 width=63) (actual time=0.249..0.807 rows=43 loops=1)

  • Hash Cond: (pontoatend6_.gestorcomercial_id = vendedor7_.id)
46. 0.514 0.514 ↑ 1.0 43 1

Seq Scan on pontoatendimento pontoatend6_ (cost=0.00..19.48 rows=43 width=63) (actual time=0.005..0.514 rows=43 loops=1)

  • Filter: (tipopontoatendimento = 1)
  • Rows Removed by Filter: 315
47. 0.137 0.239 ↑ 1.0 647 1

Hash (cost=12.47..12.47 rows=647 width=4) (actual time=0.239..0.239 rows=647 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 31kB
48. 0.102 0.102 ↑ 1.0 647 1

Seq Scan on vendedor vendedor7_ (cost=0.00..12.47 rows=647 width=4) (actual time=0.006..0.102 rows=647 loops=1)

49. 0.301 0.301 ↑ 1.0 1 43

Index Scan using pessoa_pkey on pessoa vendedor7_1_ (cost=0.42..6.99 rows=1 width=34) (actual time=0.007..0.007 rows=1 loops=43)

  • Index Cond: (vendedor7_.id = id)
50. 0.028 0.086 ↑ 1.0 83 1

Hash (cost=3.10..3.10 rows=83 width=64) (actual time=0.086..0.086 rows=83 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 17kB
51. 0.058 0.058 ↑ 1.0 83 1

Seq Scan on produto produto9_ (cost=0.00..3.10 rows=83 width=64) (actual time=0.016..0.058 rows=83 loops=1)

  • Filter: (tipo = 0)
  • Rows Removed by Filter: 5
52. 0.000 0.006 ↓ 0.0 0 1

Hash (cost=12.10..12.10 rows=210 width=354) (actual time=0.006..0.006 rows=0 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 8kB
53. 0.007 0.007 ↓ 0.0 0 1

Seq Scan on taxadelivery taxadelive4_ (cost=0.00..12.10 rows=210 width=354) (actual time=0.006..0.007 rows=0 loops=1)

54. 0.661 1.840 ↑ 1.0 1,498 1

Hash (cost=74.98..74.98 rows=1,498 width=14) (actual time=1.840..1.840 rows=1,498 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 87kB
55. 1.179 1.179 ↑ 1.0 1,498 1

Seq Scan on notafiscalproduto listanotaf11_ (cost=0.00..74.98 rows=1,498 width=14) (actual time=0.116..1.179 rows=1,498 loops=1)

56. 0.041 0.213 ↑ 1.0 39 1

Hash (cost=1.39..1.39 rows=39 width=242) (actual time=0.213..0.213 rows=39 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 12kB
57. 0.172 0.172 ↑ 1.0 39 1

Seq Scan on formapagamento formapagam13_ (cost=0.00..1.39 rows=39 width=242) (actual time=0.133..0.172 rows=39 loops=1)

58. 0.332 0.790 ↑ 1.0 684 1

Hash (cost=17.84..17.84 rows=684 width=35) (actual time=0.790..0.790 rows=684 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 48kB
59. 0.458 0.458 ↑ 1.0 684 1

Seq Scan on voucher voucher14_ (cost=0.00..17.84 rows=684 width=35) (actual time=0.107..0.458 rows=684 loops=1)

60. 0.000 0.000 ↓ 0.0 0 21,472

Index Only Scan using documento_pkey on documento documento15_ (cost=0.29..5.44 rows=1 width=4) (actual time=0.000..0.000 rows=0 loops=21,472)

  • Index Cond: (id = voucher14_.documento_id)
  • Heap Fetches: 0
61. 0.025 0.063 ↑ 1.0 39 1

Hash (cost=1.39..1.39 rows=39 width=191) (actual time=0.063..0.063 rows=39 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 11kB
62. 0.038 0.038 ↑ 1.0 39 1

Seq Scan on formapagamento formapagam18_ (cost=0.00..1.39 rows=39 width=191) (actual time=0.008..0.038 rows=39 loops=1)

63. 0.016 0.085 ↑ 1.0 22 1

Hash (cost=1.22..1.22 rows=22 width=123) (actual time=0.085..0.085 rows=22 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 10kB
64. 0.069 0.069 ↑ 1.0 22 1

Seq Scan on conta conta19_ (cost=0.00..1.22 rows=22 width=123) (actual time=0.054..0.069 rows=22 loops=1)

Planning time : 9.664 ms
Execution time : 2,310.701 ms