Advertisement
Guest User

Untitled

a guest
Nov 13th, 2019
289
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.45 KB | None | 0 0
  1. EXPLAIN (ANALYZE, VERBOSE)
  2. SELECT c.concod,
  3. cp.conparnum,
  4. cp.conpardatven
  5. FROM contrato c
  6. JOIN contrato_parcela cp USING (concod)
  7. JOIN contrato_parcela x ON (c.concod = x.concod --This is contrato_parcela's FK to contrato
  8. AND cp.conpardatven = x.conpardatven
  9. AND cp.conparnum = x.conparnum
  10. AND cp.conparseq <> x.conparseq) --This is contrato_parcela's PK
  11. WHERE carcod = 100
  12. GROUP BY 1,2,3
  13.  
  14. /*************************************************************************************************/
  15.  
  16. Group (cost=1379793.20..1379834.52 rows=322 width=14) (actual time=64112.474..64112.746 rows=86 loops=1)
  17. Output: c.concod, cp.conparnum, cp.conpardatven
  18. Group Key: c.concod, cp.conparnum, cp.conpardatven
  19. -> Gather Merge (cost=1379793.20..1379832.12 rows=320 width=14) (actual time=64112.471..64199.103 rows=155 loops=1)
  20. Output: c.concod, cp.conparnum, cp.conpardatven
  21. Workers Planned: 4
  22. Workers Launched: 4
  23. -> Group (cost=1378793.14..1378793.94 rows=80 width=14) (actual time=64096.603..64096.634 rows=31 loops=5)
  24. Output: c.concod, cp.conparnum, cp.conpardatven
  25. Group Key: c.concod, cp.conparnum, cp.conpardatven
  26. Worker 0: actual time=64094.039..64094.074 rows=33 loops=1
  27. Worker 1: actual time=64094.093..64094.125 rows=33 loops=1
  28. Worker 2: actual time=64093.566..64093.591 rows=24 loops=1
  29. Worker 3: actual time=64093.156..64093.179 rows=25 loops=1
  30. -> Sort (cost=1378793.14..1378793.34 rows=80 width=14) (actual time=64096.600..64096.607 rows=34 loops=5)
  31. Output: c.concod, cp.conparnum, cp.conpardatven
  32. Sort Key: c.concod, cp.conparnum, cp.conpardatven
  33. Sort Method: quicksort Memory: 27kB
  34. Worker 0: actual time=64094.037..64094.044 rows=34 loops=1
  35. Worker 1: actual time=64094.090..64094.096 rows=39 loops=1
  36. Worker 2: actual time=64093.564..64093.569 rows=29 loops=1
  37. Worker 3: actual time=64093.153..64093.158 rows=25 loops=1
  38. -> Nested Loop (cost=34359.20..1378790.62 rows=80 width=14) (actual time=3474.066..64096.432 rows=34 loops=5)
  39. Output: c.concod, cp.conparnum, cp.conpardatven
  40. Join Filter: (c.concod = x.concod)
  41. Worker 0: actual time=3048.647..64093.871 rows=34 loops=1
  42. Worker 1: actual time=3255.442..64093.896 rows=39 loops=1
  43. Worker 2: actual time=4789.976..64093.371 rows=29 loops=1
  44. Worker 3: actual time=4787.954..64092.972 rows=25 loops=1
  45. -> Hash Join (cost=34358.64..756866.52 rows=863635 width=30) (actual time=1167.848..43118.275 rows=1357506 loops=5)
  46. Output: c.concod, cp.conparnum, cp.conpardatven, cp.concod, cp.conparseq
  47. Inner Unique: true
  48. Hash Cond: (cp.concod = c.concod)
  49. Worker 0: actual time=1251.163..42968.535 rows=1332136 loops=1
  50. Worker 1: actual time=1198.173..43042.687 rows=1367669 loops=1
  51. Worker 2: actual time=1179.430..43150.192 rows=1359708 loops=1
  52. Worker 3: actual time=1109.819..43046.882 rows=1379615 loops=1
  53. -> Parallel Seq Scan on public.contrato_parcela cp (cost=0.00..714671.57 rows=2985257 width=22) (actual time=0.792..38747.721 rows=2392501 loops=5)
  54. Output: cp.conparseq, cp.concod, cp.conparnum, cp.conpardatcad, cp.conpardatven, cp.conparvallan, cp.conpardadadi, cp.conparbancod, cp.conparage, cp.conparcon, cp.conparnumche, cp.conpardatapre, cp.conparborent, cp.conparali, cp.conparati, cp.conparusuinc, cp.conpardatatu, cp.conparusuatu, cp.conpardatinc, cp.conparacocod, cp.enccod, cp.conparstacal, cp.tiplancod, cp.conparidt, cp.conparvalsal, cp.conparvin, cp.conparboratu, cp.conparprocod, cp.conparpro, cp.conpartax, cp.conparvalori
  55. Worker 0: actual time=0.790..38469.672 rows=2352827 loops=1
  56. Worker 1: actual time=1.359..38647.384 rows=2409347 loops=1
  57. Worker 2: actual time=1.027..38760.445 rows=2389255 loops=1
  58. Worker 3: actual time=0.448..38764.390 rows=2436591 loops=1
  59. -> Hash (cost=23428.55..23428.55 rows=874407 width=8) (actual time=1160.117..1160.117 rows=879841 loops=5)
  60. Output: c.concod
  61. Buckets: 1048576 Batches: 1 Memory Usage: 42561kB
  62. Worker 0: actual time=1236.146..1236.146 rows=879841 loops=1
  63. Worker 1: actual time=1190.840..1190.841 rows=879841 loops=1
  64. Worker 2: actual time=1171.834..1171.834 rows=879841 loops=1
  65. Worker 3: actual time=1103.042..1103.042 rows=879841 loops=1
  66. -> Index Only Scan using contrato_iu0004 on public.contrato c (cost=0.43..23428.55 rows=874407 width=8) (actual time=0.130..769.098 rows=879841 loops=5)
  67. Output: c.concod
  68. Index Cond: (c.carcod = 100)
  69. Heap Fetches: 140473
  70. Worker 0: actual time=0.254..817.281 rows=879841 loops=1
  71. Worker 1: actual time=0.146..807.609 rows=879841 loops=1
  72. Worker 2: actual time=0.112..785.281 rows=879841 loops=1
  73. Worker 3: actual time=0.107..727.101 rows=879841 loops=1
  74. -> Index Scan using contrato_parcela_iu0010 on public.contrato_parcela x (cost=0.56..0.71 rows=1 width=22) (actual time=0.014..0.014 rows=0 loops=6787531)
  75. Output: x.conparseq, x.concod, x.conparnum, x.conpardatcad, x.conpardatven, x.conparvallan, x.conpardadadi, x.conparbancod, x.conparage, x.conparcon, x.conparnumche, x.conpardatapre, x.conparborent, x.conparali, x.conparati, x.conparusuinc, x.conpardatatu, x.conparusuatu, x.conpardatinc, x.conparacocod, x.enccod, x.conparstacal, x.tiplancod, x.conparidt, x.conparvalsal, x.conparvin, x.conparboratu, x.conparprocod, x.conparpro, x.conpartax, x.conparvalori
  76. Index Cond: ((x.conpardatven = cp.conpardatven) AND (x.concod = cp.concod))
  77. Filter: ((cp.conparseq <> x.conparseq) AND (cp.conparnum = x.conparnum))
  78. Rows Removed by Filter: 1
  79. Worker 0: actual time=0.014..0.014 rows=0 loops=1332136
  80. Worker 1: actual time=0.014..0.014 rows=0 loops=1367669
  81. Worker 2: actual time=0.014..0.014 rows=0 loops=1359708
  82. Worker 3: actual time=0.014..0.014 rows=0 loops=1379615
  83. Planning time: 2.652 ms
  84. Execution time: 64200.962 ms
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement