explain.depesz.com

PostgreSQL's explain analyze made readable

Result: ETAq

Settings
# exclusive inclusive rows x rows loops node
1. 0.215 24,165.472 ↑ 3.0 248 1

Unique (cost=77,090.84..77,094.60 rows=750 width=20) (actual time=24,165.112..24,165.472 rows=248 loops=1)

2. 1.987 24,165.257 ↓ 5.2 3,873 1

Sort (cost=77,090.84..77,092.72 rows=752 width=20) (actual time=24,165.110..24,165.257 rows=3,873 loops=1)

  • Sort Key: account_id, "timestamp" DESC
  • Sort Method: quicksort Memory: 399kB
3. 76.739 24,163.270 ↓ 5.2 3,873 1

Bitmap Heap Scan on payment (cost=73,875.48..77,054.91 rows=752 width=20) (actual time=24,090.035..24,163.270 rows=3,873 loops=1)

  • Recheck Cond: ((account_id = ANY ('{247,2428,2573,2966,3024,3261,3435,4019,4644,6043,7246,7542,7655,9766,10126,11574,12495,17109,19005,22208,23318,26426,28183,28961,30421,30866,32723,40763,40903,41833,43055,46382,46494,46844,46981,49772,50551,50887,52484,54570,55730,57742,58103,59375,59524,59826,61575,62823,62923,65402,66228,67829,69202,70846,74397,75370,78395,79081,84826,85012,86766,86777,87095,87478,87556,89407,90316,90755,94214,96674,99310,101928,102892,104499,107164,108795,109606,109850,110137,110661,112622,113775,115479,116544,118360,119044,120962,121514,121949,122505,123432,123529,124141,127372,130162,131261,132079,134767,135967,138396,138887,139993,141356,141786,141811,142209,142247,145126,145511,146630,146673,149931,150881,151744,152355,152451,152908,153288,155129,155475,155686,156671,156676,158080,160375,161830,165817,165910,167410,167573,167577,168107,169167,170633,172459,172473,174118,175020,177219,177625,177949,177995,180200,180760,184651,184717,185895,187331,188720,194109,195945,196334,197508,197845,197877,198691,199768,200140,200240,200386,200517,201498,201580,203265,203564,204098,205534,205873,207834,210384,216342,217439,218425,219557,223073,223095,225115,225377,225615,226170,230555,230934,233556,235074,237935,242904,243110,243178,243430,246229,247360,248281,248493,248649,249095,250199,253939,255335,256154,259394,260459,261170,263384,266832,266875,275038,278533,282054,290066,301890,303371,305401,307383,309408,310095,310697,310968,313262,313889,314561,318016,318710,319411,319714,320720,323456,323510,327512,328582,328772,331605,332462,333464,335524,336570,338052,338774,341101,342038,345718,345779,349083,349309,350764,350993,351620,352579,353276,354673,355372,356645,357701,358499,360530,361279,362258,363841,365092,365262,366892,366973,369352,371564,374788,377689,378509,378533,383133,383657,384254,385699,386584,388553,389300,389366,396226,396260,400422,400494,400544,400959,401750,405429,406145,408394,408436,408649,409961,411736,412897,415830,419231,419625,422695,424918,427236,430254,431827,436228,436267}'::integer[])) AND ("timestamp" >= '2020-05-01 00:00:00'::timestamp without time zone) AND ("timestamp" <= '2020-05-08 00:00:00'::timestamp without time zone) AND (name_operation_bm <> 'Tain Casino'::text))
  • Filter: (is_payment AND (transaction_type = 'D'::transaction_type_type))
  • Rows Removed by Filter: 1934
  • Heap Blocks: exact=5676
4. 59.479 24,086.531 ↓ 0.0 0 1

BitmapAnd (cost=73,875.48..73,875.48 rows=1,877 width=0) (actual time=24,086.531..24,086.531 rows=0 loops=1)

5. 3,017.318 3,017.318 ↑ 2.8 286,472 1

Bitmap Index Scan on payment_account_id_idx (cost=0.00..34,303.60 rows=811,022 width=0) (actual time=3,017.318..3,017.318 rows=286,472 loops=1)

  • Index Cond: (account_id = ANY ('{247,2428,2573,2966,3024,3261,3435,4019,4644,6043,7246,7542,7655,9766,10126,11574,12495,17109,19005,22208,23318,26426,28183,28961,30421,30866,32723,40763,40903,41833,43055,46382,46494,46844,46981,49772,50551,50887,52484,54570,55730,57742,58103,59375,59524,59826,61575,62823,62923,65402,66228,67829,69202,70846,74397,75370,78395,79081,84826,85012,86766,86777,87095,87478,87556,89407,90316,90755,94214,96674,99310,101928,102892,104499,107164,108795,109606,109850,110137,110661,112622,113775,115479,116544,118360,119044,120962,121514,121949,122505,123432,123529,124141,127372,130162,131261,132079,134767,135967,138396,138887,139993,141356,141786,141811,142209,142247,145126,145511,146630,146673,149931,150881,151744,152355,152451,152908,153288,155129,155475,155686,156671,156676,158080,160375,161830,165817,165910,167410,167573,167577,168107,169167,170633,172459,172473,174118,175020,177219,177625,177949,177995,180200,180760,184651,184717,185895,187331,188720,194109,195945,196334,197508,197845,197877,198691,199768,200140,200240,200386,200517,201498,201580,203265,203564,204098,205534,205873,207834,210384,216342,217439,218425,219557,223073,223095,225115,225377,225615,226170,230555,230934,233556,235074,237935,242904,243110,243178,243430,246229,247360,248281,248493,248649,249095,250199,253939,255335,256154,259394,260459,261170,263384,266832,266875,275038,278533,282054,290066,301890,303371,305401,307383,309408,310095,310697,310968,313262,313889,314561,318016,318710,319411,319714,320720,323456,323510,327512,328582,328772,331605,332462,333464,335524,336570,338052,338774,341101,342038,345718,345779,349083,349309,350764,350993,351620,352579,353276,354673,355372,356645,357701,358499,360530,361279,362258,363841,365092,365262,366892,366973,369352,371564,374788,377689,378509,378533,383133,383657,384254,385699,386584,388553,389300,389366,396226,396260,400422,400494,400544,400959,401750,405429,406145,408394,408436,408649,409961,411736,412897,415830,419231,419625,422695,424918,427236,430254,431827,436228,436267}'::integer[]))
6. 21,009.734 21,009.734 ↓ 35.6 31,513,965 1

Bitmap Index Scan on payment_timestamp_idx (cost=0.00..39,571.25 rows=884,128 width=0) (actual time=21,009.734..21,009.734 rows=31,513,965 loops=1)

  • Index Cond: (("timestamp" >= '2020-05-01 00:00:00'::timestamp without time zone) AND ("timestamp" <= '2020-05-08 00:00:00'::timestamp without time zone))
Planning time : 9.937 ms
Execution time : 24,169.452 ms