explain.depesz.com

PostgreSQL's explain analyze made readable

Result: AI4BX

Settings
# exclusive inclusive rows x rows loops node
1. 11.809 1,187,928.784 ↑ 10.8 7,529 1

Sort (cost=605,413.15..605,615.65 rows=81,001 width=416) (actual time=1,187,927.943..1,187,928.784 rows=7,529 loops=1)

  • Sort Key: (to_char(((result.data)::time without time zone)::interval, 'HH24MISS'::text))
  • Sort Method: quicksort Memory: 2110kB
  • Buffers: shared hit=28468 read=307841 dirtied=4781 written=2136, temp read=114117206 written=166185
2.          

CTE list

3. 0.000 18,854.304 ↓ 7,529.0 7,529 1

Unique (cost=288.46..288.46 rows=1 width=108) (actual time=18,835.424..18,854.304 rows=7,529 loops=1)

  • Buffers: shared hit=4, temp read=429 written=430
4.          

Initplan (for Unique)

5. 18.151 18.151 ↑ 15.0 1 1

Foreign Scan (cost=100..146.86 rows=15 width=4) (actual time=18.15..18.151 rows=1 loops=1)

6. 45.243 18,848.899 ↓ 7,529.0 7,529 1

Sort (cost=141.59..141.6 rows=1 width=108) (actual time=18,835.422..18,848.899 rows=7,529 loops=1)

  • Sort Key: ldt_1.uid
  • Sort Method: external merge Disk: 3432kB
  • Buffers: shared hit=4, temp read=429 written=430
7. 3.512 18,803.656 ↓ 7,529.0 7,529 1

Hash Join (cost=130.39..141.58 rows=1 width=108) (actual time=18,800.175..18,803.656 rows=7,529 loops=1)

  • Buffers: shared hit=4
8. 0.070 0.070 ↑ 1.0 359 1

Seq Scan on tb_localization_celpa_cemar tlc (cost=0..7.59 rows=359 width=24) (actual time=0.022..0.07 rows=359 loops=1)

  • Buffers: shared hit=4
9. 6.249 18,800.074 ↓ 7,529.0 7,529 1

Hash (cost=130.38..130.38 rows=1 width=76) (actual time=18,800.074..18,800.074 rows=7,529 loops=1)

10. 18,793.825 18,793.825 ↓ 7,529.0 7,529 1

Foreign Scan (cost=100..130.38 rows=1 width=76) (actual time=18,022.706..18,793.825 rows=7,529 loops=1)

  • Filter: (ltrim((ldt_1.data -> 'remessa'::text), '0'::text) = '7160'::text)
11.          

CTE calls

12. 7.319 44,763.209 ↓ 136.9 7,390 1

Hash Join (cost=393,806.74..394,263.7 rows=54 width=547) (actual time=43,805.873..44,763.209 rows=7,390 loops=1)

  • Buffers: shared hit=28433 read=307841 dirtied=4781 written=2136
13. 3.455 44,742.689 ↓ 136.9 7,390 1

Nested Loop (cost=393,793.77..394,250.17 rows=54 width=515) (actual time=43,792.621..44,742.689 rows=7,390 loops=1)

  • Buffers: shared hit=28433 read=307837 dirtied=4781 written=2136
14. 5.458 43,734.194 ↓ 136.9 7,390 1

HashAggregate (cost=393,793.33..393,793.87 rows=54 width=19) (actual time=43,731.217..43,734.194 rows=7,390 loops=1)

  • Group Key: cf.unique_id
  • Buffers: shared hit=666 read=306044 dirtied=4781 written=2136
15. 2.713 43,728.736 ↓ 136.9 7,390 1

Subquery Scan on cf (cost=393,443.43..393,793.2 rows=54 width=19) (actual time=43,706.048..43,728.736 rows=7,390 loops=1)

  • Filter: (cf.row_number = 1)
  • Buffers: shared hit=666 read=306044 dirtied=4781 written=2136
16. 55.939 43,726.023 ↓ 3.7 40,235 1

WindowAgg (cost=393,443.43..393,658.67 rows=10,762 width=47) (actual time=43,706.045..43,726.023 rows=40,235 loops=1)

  • Buffers: shared hit=666 read=306044 dirtied=4781 written=2136
17. 114.833 43,670.084 ↓ 3.7 40,235 1

Sort (cost=393,443.43..393,470.34 rows=10,762 width=39) (actual time=43,667.473..43,670.084 rows=40,235 loops=1)

  • Sort Key: info_campaign_return_file.uid, info_campaign_return_file.state_date DESC
  • Sort Method: quicksort Memory: 4089kB
  • Buffers: shared hit=666 read=306044 dirtied=4781 written=2136
18. 43,555.251 43,555.251 ↓ 3.7 40,235 1

Seq Scan on info_campaign_return_file info_campaign_return_file (cost=0..392,722.72 rows=10,762 width=39) (actual time=6,322.051..43,555.251 rows=40,235 loops=1)

  • Filter: ((info_campaign_return_file.campaign_id = 39) AND (ltrim((info_campaign_return_file.data -> 'remessa'::text), '0'::text) = '7160'::text))
  • Buffers: shared hit=666 read=306044 dirtied=4781 written=2136
19. 1,005.040 1,005.040 ↑ 1.0 1 7,390

Index Scan using info_campaign_return_file_pkey on info_campaign_return_file ic (cost=0.43..8.45 rows=1 width=515) (actual time=0.136..0.136 rows=1 loops=7,390)

  • Index Cond: (ic.unique_id = cf.unique_id)
  • Buffers: shared hit=27767 read=1793
20. 0.118 13.201 ↑ 1.0 359 1

Hash (cost=7.59..7.59 rows=359 width=24) (actual time=13.201..13.201 rows=359 loops=1)

  • Buffers: shared read=4
21. 13.083 13.083 ↑ 1.0 359 1

Seq Scan on tb_localization_celpa_cemar tlc_1 (cost=0..7.59 rows=359 width=24) (actual time=12.315..13.083 rows=359 loops=1)

  • Buffers: shared read=4
22.          

CTE ivr_data_entered

23. 0.268 391,579.680 ↑ 1.1 893 1

Unique (cost=204.24..224.24 rows=1,000 width=172) (actual time=391,579.355..391,579.68 rows=893 loops=1)

  • Buffers: shared hit=12, temp read=38984693
24. 3.405 391,579.412 ↑ 1.1 893 1

Sort (cost=204.24..206.74 rows=1,000 width=172) (actual time=391,579.353..391,579.412 rows=893 loops=1)

  • Sort Key: ivr.unique_id, ivr.begin_date, ivr.extension, ivr.node, (get_result_ivr_data_entered(ivr.node, ivr.data)), ivr.data, dt.campaign_id
  • Sort Method: quicksort Memory: 150kB
  • Buffers: shared hit=12, temp read=38984693
25. 88.582 391,576.007 ↑ 1.1 893 1

ProjectSet (cost=100..154.41 rows=1,000 width=172) (actual time=13,686.745..391,576.007 rows=893 loops=1)

  • Buffers: shared hit=9, temp read=38984693
26. 229,871.271 391,487.425 ↓ 893.0 893 1

Nested Loop (cost=100..149.16 rows=1 width=140) (actual time=13,673.488..391,487.425 rows=893 loops=1)

  • Buffers: temp read=38984693
27. 19,952.291 19,952.291 ↓ 83,479.0 83,479 1

Foreign Scan (cost=100..147.13 rows=1 width=136) (actual time=189.606..19,952.291 rows=83,479 loops=1)

28. 141,663.863 141,663.863 ↓ 136.9 7,390 83,479

CTE Scan on calls dt (cost=0..1.08 rows=54 width=44) (actual time=0.002..1.697 rows=7,390 loops=83,479)

  • Buffers: temp read=38984693
29.          

CTE report_success

30. 129.928 1,123,340.146 ↑ 24.6 2,192 1

ProjectSet (cost=703.93..999.76 rows=54,000 width=512) (actual time=1,123,208.733..1,123,340.146 rows=2,192 loops=1)

  • Buffers: shared hit=28445 read=307841 dirtied=4781 written=2136, temp read=108747434 written=163104
31. 1.365 1,123,210.218 ↓ 40.6 2,192 1

Result (cost=703.93..709.37 rows=54 width=736) (actual time=1,123,207.256..1,123,210.218 rows=2,192 loops=1)

  • Buffers: shared hit=28445 read=307841 dirtied=4781 written=2136, temp read=108747434 written=163104
32. 1.205 1,123,208.853 ↓ 40.6 2,192 1

Unique (cost=703.93..704.24 rows=54 width=736) (actual time=1,123,207.233..1,123,208.853 rows=2,192 loops=1)

  • Buffers: shared hit=28445 read=307841 dirtied=4781 written=2136, temp read=108747434 written=163104
33. 8.034 1,123,207.648 ↓ 41.1 2,546 1

Sort (cost=703.93..704.09 rows=62 width=736) (actual time=1,123,207.231..1,123,207.648 rows=2,546 loops=1)

  • Sort Key: calls.unique_id, calls.state_date DESC
  • Sort Method: quicksort Memory: 2679kB
  • Buffers: shared hit=28445 read=307841 dirtied=4781 written=2136, temp read=108747434 written=163104
34. 1.534 1,123,199.614 ↓ 41.1 2,546 1

Hash Join (cost=587.52..702.08 rows=62 width=736) (actual time=1,123,198.168..1,123,199.614 rows=2,546 loops=1)

  • Buffers: shared hit=28445 read=307841 dirtied=4781 written=2136, temp read=108747434 written=163104
35. 29.645 29.645 ↑ 108.3 27 1

Foreign Scan (cost=100..197.75 rows=2,925 width=4) (actual time=29.641..29.645 rows=27 loops=1)

36. 2.650 1,123,168.435 ↓ 636.5 2,546 1

Hash (cost=487.47..487.47 rows=4 width=484) (actual time=1,123,168.435..1,123,168.435 rows=2,546 loops=1)

  • Buffers: shared hit=28445 read=307841 dirtied=4781 written=2136, temp read=108747434 written=163104
37. 3.468 1,123,165.785 ↓ 636.5 2,546 1

Hash Join (cost=450.59..487.47 rows=4 width=484) (actual time=1,122,624.145..1,123,165.785 rows=2,546 loops=1)

  • Buffers: shared hit=28445 read=307841 dirtied=4781 written=2136, temp read=108747434 written=163104
38. 1.564 1,078,366.542 ↓ 636.5 2,546 1

Hash Join (cost=448.83..485.66 rows=4 width=408) (actual time=1,077,828.343..1,078,366.542 rows=2,546 loops=1)

  • Buffers: shared hit=12, temp read=108747434 written=162638
39. 181.645 1,078,359.114 ↓ 159.1 2,546 1

Hash Join (cost=447.08..483.8 rows=16 width=376) (actual time=1,077,822.438..1,078,359.114 rows=2,546 loops=1)

  • Buffers: shared hit=12, temp read=108746967 written=162637
40. 4,631.485 4,631.485 ↓ 1,105.5 870,034 1

Foreign Scan (cost=100..133.61 rows=787 width=80) (actual time=65.698..4,631.485 rows=870,034 loops=1)

41. 0.595 1,073,545.984 ↓ 548.2 2,193 1

Hash (cost=347.03..347.03 rows=4 width=296) (actual time=1,073,545.984..1,073,545.984 rows=2,193 loops=1)

  • Buffers: shared hit=12, temp read=108746967 written=162637
42. 0.886 1,073,545.389 ↓ 548.2 2,193 1

Subquery Scan on iiv (cost=345.99..347.03 rows=4 width=296) (actual time=1,071,905.176..1,073,545.389 rows=2,193 loops=1)

  • Filter: (iiv.begin_date IS NOT NULL)
  • Buffers: shared hit=12, temp read=108746967 written=162637
43. 43.810 1,073,544.503 ↓ 548.2 2,193 1

Unique (cost=345.99..346.99 rows=4 width=424) (actual time=1,071,905.115..1,073,544.503 rows=2,193 loops=1)

  • Buffers: shared hit=12, temp read=108746967 written=162637
44. 828.686 1,073,500.693 ↓ 165,650.8 662,603 1

Group (cost=345.99..346.98 rows=4 width=424) (actual time=1,071,905.111..1,073,500.693 rows=662,603 loops=1)

  • Group Key: dt_1.uid, ivr_2.unique_id, ivr_2.begin_date, ((ivr_2.data)::hstore), oe.integration_vars, oe.node
  • Buffers: shared hit=12, temp read=108746967 written=162637
45. 11,400.396 1,072,672.007 ↓ 165,650.8 662,603 1

Sort (cost=345.99..346 rows=4 width=200) (actual time=1,071,905.063..1,072,672.007 rows=662,603 loops=1)

  • Sort Key: dt_1.uid, ivr_2.unique_id, ivr_2.begin_date, ((ivr_2.data)::hstore), oe.integration_vars, oe.node
  • Sort Method: external merge Disk: 476808kB
  • Buffers: shared hit=12, temp read=108746967 written=162637
46. 1,854.244 1,061,271.611 ↓ 165,650.8 662,603 1

Hash Join (cost=325.01..345.95 rows=4 width=200) (actual time=1,053,952.67..1,061,271.611 rows=662,603 loops=1)

  • Buffers: shared hit=12, temp read=108584505
47. 298.986 6,132.894 ↓ 165,460.0 661,840 1

Hash Join (cost=101.75..122.52 rows=4 width=104) (actual time=668.165..6,132.894 rows=661,840 loops=1)

  • Buffers: temp read=467
48. 5,827.434 5,827.434 ↓ 165,460.0 661,840 1

Foreign Scan (cost=100..120.74 rows=4 width=72) (actual time=661.659..5,827.434 rows=661,840 loops=1)

49. 2.002 6.474 ↓ 136.9 7,390 1

Hash (cost=1.08..1.08 rows=54 width=64) (actual time=6.474..6.474 rows=7,390 loops=1)

  • Buffers: temp read=467
50. 4.472 4.472 ↓ 136.9 7,390 1

CTE Scan on calls dt_1 (cost=0..1.08 rows=54 width=64) (actual time=0.023..4.472 rows=7,390 loops=1)

  • Buffers: temp read=467
51. 0.602 1,053,284.473 ↓ 10.4 2,076 1

Hash (cost=220.76..220.76 rows=200 width=96) (actual time=1,053,284.473..1,053,284.473 rows=2,076 loops=1)

  • Buffers: shared hit=12, temp read=108584038
52. 0.226 1,053,283.871 ↓ 10.4 2,076 1

Subquery Scan on oe (cost=215.26..220.76 rows=200 width=96) (actual time=1,053,282.238..1,053,283.871 rows=2,076 loops=1)

  • Buffers: shared hit=12, temp read=108584038
53. 4.781 1,053,283.645 ↓ 10.4 2,076 1

HashAggregate (cost=215.26..218.76 rows=200 width=164) (actual time=1,053,282.235..1,053,283.645 rows=2,076 loops=1)

  • Group Key: ivr_data_entered.campaign_id, ivr_data_entered.extension, ivr_data_entered.unique_id, ivr_data_entered.node
  • Buffers: shared hit=12, temp read=108584038
54. 0.298 1,053,278.864 ↓ 2.9 2,911 1

Append (cost=0..195.24 rows=1,001 width=132) (actual time=391,579.454..1,053,278.864 rows=2,911 loops=1)

  • Buffers: shared hit=12, temp read=108584038
55. 391,580.044 391,580.044 ↑ 1.1 893 1

CTE Scan on ivr_data_entered ivr_data_entered (cost=0..20 rows=1,000 width=132) (actual time=391,579.452..391,580.044 rows=893 loops=1)

  • Buffers: shared hit=12, temp read=38984693
56. 0.397 661,698.522 ↓ 2,018.0 2,018 1

Subquery Scan on options_timeout (cost=170.2..170.23 rows=1 width=132) (actual time=661,697.352..661,698.522 rows=2,018 loops=1)

  • Buffers: temp read=69599345
57. 0.726 661,698.125 ↓ 2,018.0 2,018 1

Unique (cost=170.2..170.22 rows=1 width=172) (actual time=661,697.245..661,698.125 rows=2,018 loops=1)

  • Buffers: temp read=69599345
58. 6.396 661,697.399 ↓ 2,018.0 2,018 1

Sort (cost=170.2..170.2 rows=1 width=172) (actual time=661,697.243..661,697.399 rows=2,018 loops=1)

  • Sort Key: ivr_3.begin_date, ivr_3.unique_id, ivr_3.extension, ivr_3.node, (CASE WHEN (ivr_3.data IS NOT NULL) THEN 'sem_resposta'::text ELSE ''::text END), ivr_3.data, dt_2.campaign_id
  • Sort Method: quicksort Memory: 332kB
  • Buffers: temp read=69599345
59. 403,930.485 661,691.003 ↓ 2,018.0 2,018 1

Nested Loop (cost=100..170.19 rows=1 width=172) (actual time=18,465.957..661,691.003 rows=2,018 loops=1)

  • Buffers: temp read=69599345
60. 2,165.493 2,165.493 ↓ 149,035.0 149,035 1

Foreign Scan (cost=100..168.16 rows=1 width=136) (actual time=19.507..2,165.493 rows=149,035 loops=1)

61. 255,595.025 255,595.025 ↓ 136.9 7,390 149,035

CTE Scan on calls dt_2 (cost=0..1.08 rows=54 width=44) (actual time=0.002..1.715 rows=7,390 loops=149,035)

  • Buffers: temp read=69599345
62. 1.665 5.864 ↓ 136.9 7,390 1

Hash (cost=1.08..1.08 rows=54 width=32) (actual time=5.864..5.864 rows=7,390 loops=1)

  • Buffers: temp read=467 written=1
63. 4.199 4.199 ↓ 136.9 7,390 1

CTE Scan on calls cd (cost=0..1.08 rows=54 width=32) (actual time=0.038..4.199 rows=7,390 loops=1)

  • Buffers: temp read=467 written=1
64. 9.066 44,795.775 ↓ 136.9 7,390 1

Hash (cost=1.08..1.08 rows=54 width=172) (actual time=44,795.775..44,795.775 rows=7,390 loops=1)

  • Buffers: shared hit=28433 read=307841 dirtied=4781 written=2136, temp written=466
65. 44,786.709 44,786.709 ↓ 136.9 7,390 1

CTE Scan on calls calls (cost=0..1.08 rows=54 width=172) (actual time=43,805.882..44,786.709 rows=7,390 loops=1)

  • Buffers: shared hit=28433 read=307841 dirtied=4781 written=2136, temp written=466
66.          

CTE report_not_success

67. 509.546 839.485 ↑ 5.2 5,198 1

ProjectSet (cost=1,453.3..1,598.45 rows=27,000 width=512) (actual time=311.238..839.485 rows=5,198 loops=1)

  • Buffers: temp read=834 written=368
68. 4.220 329.939 ↓ 192.5 5,198 1

Result (cost=1,453.3..1,456.02 rows=27 width=312) (actual time=311.033..329.939 rows=5,198 loops=1)

  • Buffers: temp read=834 written=368
69. 5.040 325.719 ↓ 192.5 5,198 1

Unique (cost=1,453.3..1,455.28 rows=27 width=512) (actual time=311.015..325.719 rows=5,198 loops=1)

  • Buffers: temp read=834 written=368
70. 39.271 320.679 ↓ 13.2 5,198 1

Sort (cost=1,453.3..1,454.29 rows=395 width=512) (actual time=310.969..320.679 rows=5,198 loops=1)

  • Sort Key: calls_1.unique_id, calls_1.state_date DESC
  • Sort Method: external merge Disk: 2936kB
  • Buffers: temp read=834 written=368
71. 2.117 281.408 ↓ 13.2 5,198 1

Hash Join (cost=1,316.69..1,436.27 rows=395 width=512) (actual time=279.327..281.408 rows=5,198 loops=1)

  • Buffers: temp read=467
72. 0.570 0.570 ↑ 108.3 27 1

Foreign Scan (cost=100..197.75 rows=2,925 width=4) (actual time=0.563..0.57 rows=27 loops=1)

73. 5.110 278.721 ↓ 192.5 5,198 1

Hash (cost=1,216.35..1,216.35 rows=27 width=180) (actual time=278.72..278.721 rows=5,198 loops=1)

  • Buffers: temp read=467
74. 10.881 273.611 ↓ 192.5 5,198 1

CTE Scan on calls calls_1 (cost=1,215..1,216.35 rows=27 width=180) (actual time=265.851..273.611 rows=5,198 loops=1)

  • Filter: ((NOT (hashed SubPlan 6)) AND ((calls_1.data -> 'nome_do_cliente'::text) IS NOT NULL))
  • Buffers: temp read=467
75.          

SubPlan (for CTE Scan)

76. 262.730 262.730 ↑ 24.6 2,192 1

CTE Scan on report_success report_success (cost=0..1,080 rows=54,000 width=32) (actual time=261.014..262.73 rows=2,192 loops=1)

77.          

CTE result

78. 26.845 1,124,311.857 ↑ 11.0 7,390 1

Sort (cost=53,820.06..54,022.56 rows=81,000 width=472) (actual time=1,124,301.164..1,124,311.857 rows=7,390 loops=1)

  • Sort Key: report_success_1.data
  • Sort Method: external merge Disk: 3984kB
  • Buffers: shared hit=28461 read=307841 dirtied=4781 written=2136, temp read=108749264 written=164832
79. 4.340 1,124,285.012 ↑ 11.0 7,390 1

Unique (cost=26,606.28..30,048.78 rows=81,000 width=472) (actual time=1,124,274.728..1,124,285.012 rows=7,390 loops=1)

  • Buffers: shared hit=28458 read=307841 dirtied=4781 written=2136, temp read=108748766 written=164333
80. 52.647 1,124,280.672 ↑ 11.0 7,390 1

Sort (cost=26,606.28..26,808.78 rows=81,000 width=472) (actual time=1,124,274.725..1,124,280.672 rows=7,390 loops=1)

  • Sort Key: report_success_1."código", report_success_1.data, report_success_1."duração", report_success_1.hdata, report_success_1.resultado, report_success_1.cliente, report_success_1.telefone, report_success_1.cpc, report_success_1.conhece_cliente, report_success_1.pagar_amanha, report_success_1.pagar_3_dias, report_success_1.pagar_6_dias, report_success_1.pagar_10_dias, report_success_1.repetir_contato, report_success_1.type, report_success_1.remessa
  • Sort Method: external merge Disk: 3984kB
  • Buffers: shared hit=28458 read=307841 dirtied=4781 written=2136, temp read=108748766 written=164333
81. 1.324 1,124,228.025 ↑ 11.0 7,390 1

Append (cost=0..2,835 rows=81,000 width=472) (actual time=1,123,208.744..1,124,228.025 rows=7,390 loops=1)

  • Buffers: shared hit=28445 read=307841 dirtied=4781 written=2136, temp read=108748268 written=163834
82. 1,123,344.282 1,123,344.282 ↑ 24.6 2,192 1

CTE Scan on report_success report_success_1 (cost=0..1,080 rows=54,000 width=472) (actual time=1,123,208.743..1,123,344.282 rows=2,192 loops=1)

  • Buffers: shared hit=28445 read=307841 dirtied=4781 written=2136, temp read=108747434 written=163104
83. 882.419 882.419 ↑ 5.2 5,198 1

CTE Scan on report_not_success report_not_success (cost=0..540 rows=27,000 width=472) (actual time=311.246..882.419 rows=5,198 loops=1)

  • Buffers: temp read=834 written=730
84.          

CTE update_billing_locate

85. 92.685 265.252 ↓ 0.0 0 1

Insert on billing_locate (cost=1,496.05..1,507.38 rows=265 width=88) (actual time=265.252..265.252 rows=0 loops=1)

  • Buffers: shared hit=16 read=9 dirtied=2, temp read=1284 written=1
86. 157.828 172.567 ↑ 132.5 2 1

Subquery Scan on *SELECT* (cost=1,496.05..1,507.38 rows=265 width=88) (actual time=168.021..172.567 rows=2 loops=1)

  • Buffers: shared hit=9 read=5 dirtied=1, temp read=1284 written=1
87. 0.094 14.739 ↑ 132.5 2 1

GroupAggregate (cost=1,496.05..1,502.08 rows=265 width=92) (actual time=10.21..14.739 rows=2 loops=1)

  • Group Key: report_success_2.type, report_success_2.remessa
  • Buffers: temp read=1284 written=1
88.          

Initplan (for GroupAggregate)

89. 0.162 4.080 ↑ 1.0 1 1

Aggregate (cost=0.02..0.03 rows=1 width=8) (actual time=4.08..4.08 rows=1 loops=1)

  • Buffers: temp read=428 written=1
90. 3.918 3.918 ↓ 1,336.0 1,336 1

CTE Scan on list list (cost=0..0.02 rows=1 width=0) (actual time=0.05..3.918 rows=1,336 loops=1)

  • Filter: (list.type = 'Capital'::text)
  • Buffers: temp read=428 written=1
91. 0.360 4.442 ↑ 1.0 1 1

Aggregate (cost=0.02..0.03 rows=1 width=8) (actual time=4.442..4.442 rows=1 loops=1)

  • Buffers: temp read=428
92. 4.082 4.082 ↓ 6,193.0 6,193 1

CTE Scan on list list_1 (cost=0..0.02 rows=1 width=0) (actual time=0.038..4.082 rows=6,193 loops=1)

  • Filter: (list_1.type = 'Interior'::text)
  • Buffers: temp read=428
93. 2.067 4.530 ↑ 1.0 1 1

Aggregate (cost=0.02..0.03 rows=1 width=8) (actual time=4.53..4.53 rows=1 loops=1)

  • Buffers: temp read=428
94. 2.463 2.463 ↓ 7,529.0 7,529 1

CTE Scan on list list_2 (cost=0..0.02 rows=1 width=8) (actual time=0.004..2.463 rows=7,529 loops=1)

  • Buffers: temp read=428
95. 0.168 1.593 ↓ 1.5 415 1

Sort (cost=1,495.95..1,496.63 rows=271 width=64) (actual time=1.557..1.593 rows=415 loops=1)

  • Sort Key: report_success_2.type, report_success_2.remessa
  • Sort Method: quicksort Memory: 57kB
96. 1.425 1.425 ↓ 1.5 415 1

CTE Scan on report_success report_success_2 (cost=0..1,485 rows=271 width=64) (actual time=0.027..1.425 rows=415 loops=1)

  • Filter: ((report_success_2.cpc = 'CPC'::text) OR ((report_success_2.cpc = 'NÃO-CPC'::text) AND (report_success_2.conhece_cliente = 'Sim'::text)))
97. 2.772 1,187,916.975 ↑ 10.8 7,529 1

Unique (cost=127,841.19..130,676.23 rows=81,001 width=416) (actual time=1,187,913.347..1,187,916.975 rows=7,529 loops=1)

  • Buffers: shared hit=28465 read=307841 dirtied=4781 written=2136, temp read=114117206 written=166185
98. 35.360 1,187,914.203 ↑ 10.8 7,529 1

Sort (cost=127,841.19..128,043.7 rows=81,001 width=416) (actual time=1,187,913.343..1,187,914.203 rows=7,529 loops=1)

  • Sort Key: ('1'::text), result."código", ((SubPlan 13)), ('000000000'::text), ('COBE'::text), ('03'::text), (CASE WHEN ((result.cpc = 'CPC'::text) OR ((result.cpc = 'NÃO-CPC'::text) AND (result.conhece_cliente = 'Sim'::text))) THEN '01'::text ELSE '02'::text END), ((result.hdata -> 'remessa'::text)), (to_char(((result.data)::date)::timestamp with time zone, 'YYYYMMDD'::text)), (to_char(((result.data)::time without time zone)::interval, 'HH24MISS'::text)), ('PLANEJAMENTO'::text), result.telefone, (CASE WHEN (result.cpc = 'CPC'::text) THEN 'Titular contactado'::text WHEN (result.cpc = 'SEM-RESPOSTA'::text) THEN 'Mudo'::text WHEN (((result.cpc = 'NÃO-CPC'::text) AND (result.conhece_cliente = 'Não'::text)) OR ((result.cpc = 'NÃO-CPC'::text) AND (result.conhece_cliente IS NULL))) THEN 'Desconhece'::text WHEN ((result.cpc = 'NÃO-CPC'::text) AND (result.conhece_cliente = 'Sim'::text)) THEN 'Recado'::text WHEN (result.cpc = 'CLIENTE-DESLIGOU-NA-URA'::text) THEN 'Desligou sem confirmar titularidade'::text ELSE result.resultado END)
  • Sort Method: quicksort Memory: 2110kB
  • Buffers: shared hit=28465 read=307841 dirtied=4781 written=2136, temp read=114117206 written=166185
99. 2.779 1,187,878.843 ↑ 10.8 7,529 1

Append (cost=0..106,008.82 rows=81,001 width=416) (actual time=1,124,305.706..1,187,878.843 rows=7,529 loops=1)

  • Buffers: shared hit=28465 read=307841 dirtied=4781 written=2136, temp read=114117206 written=166185
100. 1,124,382.969 1,151,511.659 ↑ 11.0 7,390 1

CTE Scan on result result (cost=0..103,882.5 rows=81,000 width=416) (actual time=1,124,305.705..1,151,511.659 rows=7,390 loops=1)

  • Buffers: shared hit=28461 read=307841 dirtied=4781 written=2136, temp read=112200394 written=165327
101.          

SubPlan (for CTE Scan)

102. 27,128.690 27,128.690 ↑ 1.0 1 7,390

CTE Scan on calls calls_2 (cost=0..1.22 rows=1 width=32) (actual time=1.836..3.671 rows=1 loops=7,390)

  • Filter: (calls_2.uid = result."código")
  • Buffers: temp read=3451130
103. 21,472.043 36,364.405 ↓ 139.0 139 1

CTE Scan on list ldt (cost=0..911.31 rows=1 width=416) (actual time=18,967.647..36,364.405 rows=139 loops=1)

  • Filter: ((ltrim((ldt.data -> 'remessa'::text), '0'::text) = '7160'::text) AND (NOT (SubPlan 14)))
  • Buffers: shared hit=4, temp read=1916812 written=858
104.          

SubPlan (for CTE Scan)

105. 14,892.362 14,892.362 ↑ 21.5 3,764 7,529

CTE Scan on result result_1 (cost=0..1,620 rows=81,000 width=32) (actual time=0.004..1.978 rows=3,764 loops=7,529)

  • Buffers: temp read=1916383 written=1
Planning time : 5.34 ms
Execution time : 1,188,696.316 ms