explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PkMV

Settings
# exclusive inclusive rows x rows loops node
1. 11.710 137.449 ↓ 8,610.0 8,610 1

Nested Loop (cost=5,004.47..7,256.97 rows=1 width=132) (actual time=32.199..137.449 rows=8,610 loops=1)

2.          

CTE t_maiorlancamento

3. 8.484 43.721 ↓ 31.9 8,610 1

GroupAggregate (cost=4,998.65..5,004.05 rows=270 width=34) (actual time=32.158..43.721 rows=8,610 loops=1)

  • Group Key: t_lancamento_1.id_externo, t_lancamento_1.tipo
4. 13.253 35.237 ↓ 71.5 19,311 1

Sort (cost=4,998.65..4,999.32 rows=270 width=34) (actual time=32.152..35.237 rows=19,311 loops=1)

  • Sort Key: t_lancamento_1.id_externo, t_lancamento_1.tipo
  • Sort Method: quicksort Memory: 2352kB
5. 21.984 21.984 ↓ 71.5 19,311 1

Index Scan using idx_lancamento_all_cursor on t_lancamento t_lancamento_1 (cost=0.42..4,987.74 rows=270 width=34) (actual time=0.245..21.984 rows=19,311 loops=1)

  • Index Cond: ((id_pessoa = ANY ('{156494,178195,167276,173830,166143,174416,168977,165533,164125,162195,167669,161180,174526,156152,157514,159965,166036,163999,160242,170730,175094,167411,178734,160472,149311,174589,159377,175014,147833,157393,165149,165165,156428,164168,165829,172422,163743,159265,161004,178860,162767,179129,166390,157283,163308,161177,174393,164550,169150,120339,146412,163747,164383,164441,177047,160944,176299,171798,167981,173049,160849,179180,154351,163821,165572,156884,160832,167966,165971,165798,161808,162701,166192,163446,160602,168070,161616,156584,177479,177424,170298,176174,142922,178846,161705,167589,160976,158993,173958,175591,159779,165621,163842,160229,170834,170369,174427,164726,172816,176782,175543,161948,163376,161853,174915,179227,161934,168509,170385,175836,163093,168218,166906,160279,171300,175010,120516,157767,174967,178196,161340,160282,172755,177404,174329,157770,170081,172709,157355,168537,171018,174815,173065,153032,176451,171214,173742,163724,162257,177880,160189,167972,164063,165438,175965,178190,172106,159748,175530,172311,170767,165370,175141,162981,175876,162985,174909,176226,174851,157156,171114,159826,172300,169465,175956,112525,163286,174809,170335,115738,160650,163688,166971,158281,176333,176192,178365,177953,165631,163196,125363,163652,169655,172712,160307,167978,162613,172809,159338,158495,167464,160227,178102,160979,177548,176917,163083,173086,174139,173415,161024,177432,171393,168427,165318,166439,157481,173077,167422,157247,175515,156364,164202,176061,172855,172205,170222,158916,162218,173755,166345,171506,165993,166837,148086,162759,169412,179179,165416,173633,161583,165757,156531,156880,154137,159642,170358,167753,161063,176353,159914,169820,140616,159705,169905,166494,156627,163479,173796,169077,155470,156582,178345,172695,175381,174325,169647,174608,168562,160144,134078,159635,159297,168730,157084,123013,158880,159894,163381,169578,156573,175200,159644,175662,159745,175316,178136,173196,163751,171635,169670,156270,164104,168610,178148,157928,171767,160068,166984,168756,161850,166047,166552,161308,161482,133492,164668,176409,165922,172459,164046,165644,166066,176771,161855,164944,161241,178919,173419,159773,160222,178377,171900,158896,175756,160550,174090,160981,157540,172191,165744,177579,177297,168002,166352,172915,173466,157845,177949,172883,179176,128245,143257,175989,174463,169629,172541,157378,172010,175740,178536,171960,166717,156990,160534,175741,115550,161100,169058,159139,158034,160318,135047,170639,159629,163890,178577,177096,152982,157100,169453,166328,157359,159079,176434,174957,167791,130170,160288,158516,163043,157189,173205,177099,171350,177766,170861,176641,165298,176900,172001,174176,169039,171274,159118,157848,174300,161355,163646,179170,160126,164145,158831,178635,163538,163557,174602,173643,173375,167801,162354,174291,162880,165477,177911,177629,170143,161436,176013,157106,167687,177493,176410,174773,165078,160520,166857,177457,157026,172118,159022,173658,159093,167983,167606,159048,169732,172681,178366,172467,163725,159549,175478,173098,172759,167630,179089,159073,172424,171531,162804,169439,103095,174992,164694,159529,165097,170534,167636,170814,160747,177804,166116,170174,165233,164750,171231,159333,165280,167176,164730,164968,163090,173558,169502,170700,164232,156385,177157,165637,176402,173711,159326,177519,166486,162782,158877,168408,168382,174822,175995,157117,150779,157492,112649,178470,174379,170216,167382,158985,157057,159796,171224,136571,132295,162602,166563,167216,172714,157722,166705,166553,160531,171169,168031,160329,177859,177203,160895,166337,171101,163632,173926,173164,176934,168671,168194,169040,171697,157277,162445,369,175533,169048,157472,166166,175617,177243,165640,166926,179039,172339,171397,159412,177292,161768,169963,161247,158680,171828,176913,164942,159359,172353,171198,166661,165944,167992,166880,158662,170555,177692,162454,156869,159180,177772,152949,177711,177689,172264,171802,165062,175577,178558,178552,171809,157829,168807,157480,176783,176762,160959,162721,157071,178693,156608,161762,162067,171698,171329,156616,174043,167817,162203,177893,174432,168677,125229,172907,178435,158447,158633,169850,172316,160757,159680,176035,171553,160826,158198,164545,171408,175411,172990,167331,173470,165209,174731,164194,179054,160670,175627,166365,132728,157285,176520,166639,165164,177313,167644,170667,163212,156146,173151,178979,176045,172635,162648,178803,158131,172183,113430,178755,160407,169583,158263,173083,170719,161404,167688,161209,120649,159012,175924,179018,178027,176191,175766,167155,166977,177667,168873,174350,171253,172170,144580,164249,160631,159423,174053,176814,166367,171566,170290,176979,172236,178622,166710,164705,167074,174564,175953,159059,167168,162444,175378,173435,171984,159969,167896,175890,174837,164302,161747,162382,166104,157893,165990,162605,176974,169653,166338,177316,178673,159123,165152,170741,173476,177369,175644,165564,160450,173087,160485,176887,161958,175464,157438,156546,168023,174864,169715,163304,158030,173875,169711,159499,175495,177563,159662,159751,174626,178518,168545,146978,165456,176247,120765,157482,164922,171056,176444,166882,162557,175983,177324,156734,175285,162686,104208,158099,177355,168032,162634,157732,161082,160731,169773,165133,172756,170775,172076,175238,168890,157187,175224,178046,162524,159013,174646,174698,177063,177253,176659,174687,173761,173661,175679,171914,160567,158860,175852,172633,168761,170367,161789,165024,163928,161930,169534,164703,160573,175564,168915,159978,175273,171003,164005,166434,178977,177053,159391,167823,172451,164332,177032,158788,168894,167544,167026,174245,169217,156727,173453,163435,161115,171002,178931,174116,172762,172847,172482,158015,162591,173478,177057,119203,164708,157862,171661,157493,162284,158657,178701,160497,173651,178236,170624,147182,173854,156358,170875,178496,164208,167988,158213,161061,157312,176120,179053,121782,123880,166720,156947,156440,156649,171502,157745,159660,168940,161750,178694,164322,162949,162669,165552,178371,179062,158590,143056,178441,176461,171846,167188,165890,167410,176206,157025,172090,155511,172525,173258,160404,164710,167258,163721,173506,161557,171386,152759,170726,162570,158355,156594,168646,163016,166529,160708,165845,174163,176749,172781,170934,175024,163941,171586,177126,157318,159839,158163,166733,159876,164084,161872,152119,162369,168144,179138,171943,170342,168228,161326,162620,159815,176534,160482,163274,141024,167003,172180,157544,156658,168296,176178,175563,178810,176965,171913,163044,161347,163582,167977,172929,168464,162619,158776,161147,177534,169320,160234,160052,168033,165056,166382,169630,164396,163836,171777,157529,174719,172374,170689,161240,167562,177899,168922,158151,167273,161206,173646,172665,158258,173985,173626,163789,177517,157686,169786,167779,172080,169497,169978,164142,171482,162128,157203,167144,172958,173423,172871,156431,166804,173311,171404,179194,169928,178927,175938,159131,156554,174934,161610,159569,172009,159017,157447,175119,168390,160960,166457}'::bigint[])) AND (date(data_evento) >= '2019-01-01'::date) AND (date(data_evento) <= '2020-03-31'::date))
6. 48.249 48.249 ↓ 31.9 8,610 1

CTE Scan on t_maiorlancamento (cost=0.00..5.40 rows=270 width=234) (actual time=32.161..48.249 rows=8,610 loops=1)

7. 77.490 77.490 ↑ 1.0 1 8,610

Index Scan using idx_lancamento_all on t_lancamento (cost=0.42..8.31 rows=1 width=132) (actual time=0.009..0.009 rows=1 loops=8,610)

  • Index Cond: (((tipo)::text = (t_maiorlancamento.tipo)::text) AND (id_externo = t_maiorlancamento.id_externo))
  • Filter: (t_maiorlancamento.data_evento = data_evento)
  • Rows Removed by Filter: 2
Planning time : 4.741 ms
Execution time : 138.364 ms