explain.depesz.com

PostgreSQL's explain analyze made readable

Result: W2h

Settings
# exclusive inclusive rows x rows loops node
1. 36.402 1,406.487 ↓ 48.2 9,649 1

Finalize GroupAggregate (cost=287,423.14..287,434.64 rows=200 width=104) (actual time=1,366.580..1,406.487 rows=9,649 loops=1)

  • Group Key: fat_conducao_mensal.motorista_id
2. 30.541 1,370.085 ↓ 68.2 27,268 1

Sort (cost=287,423.14..287,424.14 rows=400 width=104) (actual time=1,366.561..1,370.085 rows=27,268 loops=1)

  • Sort Key: fat_conducao_mensal.motorista_id
  • Sort Method: external merge Disk: 2696kB
3. 46.462 1,339.544 ↓ 68.2 27,268 1

Gather (cost=287,362.36..287,405.86 rows=400 width=104) (actual time=1,309.880..1,339.544 rows=27,268 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
4. 618.768 1,293.082 ↓ 45.4 9,089 3

Partial HashAggregate (cost=286,362.36..286,365.86 rows=200 width=104) (actual time=1,272.201..1,293.082 rows=9,089 loops=3)

  • Group Key: fat_conducao_mensal.motorista_id
5. 38.574 674.314 ↓ 2.5 100,581 3

Result (cost=0.00..283,685.44 rows=39,658 width=108) (actual time=191.393..674.314 rows=100,581 loops=3)

6. 16.606 635.740 ↓ 2.5 100,581 3

Append (cost=0.00..283,288.86 rows=39,658 width=108) (actual time=191.391..635.740 rows=100,581 loops=3)

7. 0.002 0.002 ↓ 0.0 0 3

Parallel Seq Scan on fat_conducao_mensal (cost=0.00..0.00 rows=1 width=408) (actual time=0.002..0.002 rows=0 loops=3)

  • Filter: ((motorista_id IS NOT NULL) AND (mes_ano >= '2018-08-01'::date) AND (mes_ano <= '2019-01-01'::date) AND (uo_motorista_id = ANY ('{287,288,326,399,400,420,421,482,842,874,875,876,877,882,885,886,888,889,890,892,894,895,899,900,903,904,905,906,907,908,909,923,924,931,932,933,936,937,938,952,953,954,955,956,957,958,959,960,961,962,964,965,967,968,969,970,972,973,977,980,985,987,988,990,993,995,999,1000,1001,1002,1006,1007,1008,1009,1010,1011,1012,1013,1014,1021,1022,1023,1024,1025,1026,1027,1029,1030,1032,1037,1038,1039,1040,1041,1042,1043,1044,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1065,1066,1067,1069,1070,1071,1072,1077,1078,1080,1084,1085,1086,1087,1088,1090,1091,1092,1093,1096,1097,1098,1101,1102,1104,1109,1110,1111,1112,1116,1120,1131,1134,1135,1136,1137,1139,1140,1141,1153,1160,1161,1188,1193,1232,1236,1246,1256,1268,1281,1294,1295,1296,1297,1298,1299,1300,1301,1302,1303,1373,1382,2294,2296,2302,2315,2320,2345,2349,2372,2373,2376,2382,2392,2393,2394,2401,2420,2435,2486,2570,2594,2631,2636,2637,2671,2672,2706,2789,2790,2791,2792,2793,2794,2795,2801,2807,2808,2809,2810,2811,2813,2814,2815,2816,2817,2830,2885,2892,2895,2904,2962,2970,3165,3204,3206,3395,3418,3419,3449,3547,3567,3575,3579,3603,3604,3608,3626,3720,3726,3741,3747,3756,3758,3794,3800,3802,3848,4114,4264,4305,4351,4355}'::bigint[])) AND (uo_veiculo_id = ANY ('{287,288,326,399,400,420,421,482,842,874,875,876,877,882,885,886,888,889,890,892,894,895,899,900,903,904,905,906,907,908,909,923,924,931,932,933,936,937,938,952,953,954,955,956,957,958,959,960,961,962,964,965,967,968,969,970,972,973,977,980,985,987,988,990,993,995,999,1000,1001,1002,1006,1007,1008,1009,1010,1011,1012,1013,1014,1021,1022,1023,1024,1025,1026,1027,1029,1030,1032,1037,1038,1039,1040,1041,1042,1043,1044,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1065,1066,1067,1069,1070,1071,1072,1077,1078,1080,1084,1085,1086,1087,1088,1090,1091,1092,1093,1096,1097,1098,1101,1102,1104,1109,1110,1111,1112,1116,1120,1131,1134,1135,1136,1137,1139,1140,1141,1153,1160,1161,1188,1193,1232,1236,1246,1256,1268,1281,1294,1295,1296,1297,1298,1299,1300,1301,1302,1303,1373,1382,2294,2296,2302,2315,2320,2345,2349,2372,2373,2376,2382,2392,2393,2394,2401,2420,2435,2486,2570,2594,2631,2636,2637,2671,2672,2706,2789,2790,2791,2792,2793,2794,2795,2801,2807,2808,2809,2810,2811,2813,2814,2815,2816,2817,2830,2885,2892,2895,2904,2962,2970,3165,3204,3206,3395,3418,3419,3449,3547,3567,3575,3579,3603,3604,3608,3626,3720,3726,3741,3747,3756,3758,3794,3800,3802,3848,4114,4264,4305,4351,4355}'::bigint[])))
8. 387.525 551.321 ↓ 2.4 83,254 3

Parallel Bitmap Heap Scan on fat_conducao_mensal fat_conducao_mensal_1 (cost=17,807.74..247,201.93 rows=35,389 width=109) (actual time=191.388..551.321 rows=83,254 loops=3)

  • Recheck Cond: ((uo_veiculo_id = ANY ('{287,288,326,399,400,420,421,482,842,874,875,876,877,882,885,886,888,889,890,892,894,895,899,900,903,904,905,906,907,908,909,923,924,931,932,933,936,937,938,952,953,954,955,956,957,958,959,960,961,962,964,965,967,968,969,970,972,973,977,980,985,987,988,990,993,995,999,1000,1001,1002,1006,1007,1008,1009,1010,1011,1012,1013,1014,1021,1022,1023,1024,1025,1026,1027,1029,1030,1032,1037,1038,1039,1040,1041,1042,1043,1044,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1065,1066,1067,1069,1070,1071,1072,1077,1078,1080,1084,1085,1086,1087,1088,1090,1091,1092,1093,1096,1097,1098,1101,1102,1104,1109,1110,1111,1112,1116,1120,1131,1134,1135,1136,1137,1139,1140,1141,1153,1160,1161,1188,1193,1232,1236,1246,1256,1268,1281,1294,1295,1296,1297,1298,1299,1300,1301,1302,1303,1373,1382,2294,2296,2302,2315,2320,2345,2349,2372,2373,2376,2382,2392,2393,2394,2401,2420,2435,2486,2570,2594,2631,2636,2637,2671,2672,2706,2789,2790,2791,2792,2793,2794,2795,2801,2807,2808,2809,2810,2811,2813,2814,2815,2816,2817,2830,2885,2892,2895,2904,2962,2970,3165,3204,3206,3395,3418,3419,3449,3547,3567,3575,3579,3603,3604,3608,3626,3720,3726,3741,3747,3756,3758,3794,3800,3802,3848,4114,4264,4305,4351,4355}'::bigint[])) AND (mes_ano >= '2018-08-01'::date) AND (mes_ano <= '2019-01-01'::date))
  • Filter: ((motorista_id IS NOT NULL) AND (uo_motorista_id = ANY ('{287,288,326,399,400,420,421,482,842,874,875,876,877,882,885,886,888,889,890,892,894,895,899,900,903,904,905,906,907,908,909,923,924,931,932,933,936,937,938,952,953,954,955,956,957,958,959,960,961,962,964,965,967,968,969,970,972,973,977,980,985,987,988,990,993,995,999,1000,1001,1002,1006,1007,1008,1009,1010,1011,1012,1013,1014,1021,1022,1023,1024,1025,1026,1027,1029,1030,1032,1037,1038,1039,1040,1041,1042,1043,1044,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1065,1066,1067,1069,1070,1071,1072,1077,1078,1080,1084,1085,1086,1087,1088,1090,1091,1092,1093,1096,1097,1098,1101,1102,1104,1109,1110,1111,1112,1116,1120,1131,1134,1135,1136,1137,1139,1140,1141,1153,1160,1161,1188,1193,1232,1236,1246,1256,1268,1281,1294,1295,1296,1297,1298,1299,1300,1301,1302,1303,1373,1382,2294,2296,2302,2315,2320,2345,2349,2372,2373,2376,2382,2392,2393,2394,2401,2420,2435,2486,2570,2594,2631,2636,2637,2671,2672,2706,2789,2790,2791,2792,2793,2794,2795,2801,2807,2808,2809,2810,2811,2813,2814,2815,2816,2817,2830,2885,2892,2895,2904,2962,2970,3165,3204,3206,3395,3418,3419,3449,3547,3567,3575,3579,3603,3604,3608,3626,3720,3726,3741,3747,3756,3758,3794,3800,3802,3848,4114,4264,4305,4351,4355}'::bigint[])))
  • Rows Removed by Filter: 9402
  • Heap Blocks: exact=15161
9. 163.796 163.796 ↑ 1.1 278,480 1

Bitmap Index Scan on idx_2018_01_fat_conducao_mensal_uo_veic (cost=0.00..17,786.50 rows=305,206 width=0) (actual time=163.796..163.796 rows=278,480 loops=1)

  • Index Cond: ((uo_veiculo_id = ANY ('{287,288,326,399,400,420,421,482,842,874,875,876,877,882,885,886,888,889,890,892,894,895,899,900,903,904,905,906,907,908,909,923,924,931,932,933,936,937,938,952,953,954,955,956,957,958,959,960,961,962,964,965,967,968,969,970,972,973,977,980,985,987,988,990,993,995,999,1000,1001,1002,1006,1007,1008,1009,1010,1011,1012,1013,1014,1021,1022,1023,1024,1025,1026,1027,1029,1030,1032,1037,1038,1039,1040,1041,1042,1043,1044,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1065,1066,1067,1069,1070,1071,1072,1077,1078,1080,1084,1085,1086,1087,1088,1090,1091,1092,1093,1096,1097,1098,1101,1102,1104,1109,1110,1111,1112,1116,1120,1131,1134,1135,1136,1137,1139,1140,1141,1153,1160,1161,1188,1193,1232,1236,1246,1256,1268,1281,1294,1295,1296,1297,1298,1299,1300,1301,1302,1303,1373,1382,2294,2296,2302,2315,2320,2345,2349,2372,2373,2376,2382,2392,2393,2394,2401,2420,2435,2486,2570,2594,2631,2636,2637,2671,2672,2706,2789,2790,2791,2792,2793,2794,2795,2801,2807,2808,2809,2810,2811,2813,2814,2815,2816,2817,2830,2885,2892,2895,2904,2962,2970,3165,3204,3206,3395,3418,3419,3449,3547,3567,3575,3579,3603,3604,3608,3626,3720,3726,3741,3747,3756,3758,3794,3800,3802,3848,4114,4264,4305,4351,4355}'::bigint[])) AND (mes_ano >= '2018-08-01'::date) AND (mes_ano <= '2019-01-01'::date))
10. 57.442 67.811 ↓ 4.1 17,327 3

Parallel Bitmap Heap Scan on fat_conducao_mensal fat_conducao_mensal_2 (cost=2,531.79..36,086.93 rows=4,268 width=96) (actual time=12.887..67.811 rows=17,327 loops=3)

  • Recheck Cond: ((uo_veiculo_id = ANY ('{287,288,326,399,400,420,421,482,842,874,875,876,877,882,885,886,888,889,890,892,894,895,899,900,903,904,905,906,907,908,909,923,924,931,932,933,936,937,938,952,953,954,955,956,957,958,959,960,961,962,964,965,967,968,969,970,972,973,977,980,985,987,988,990,993,995,999,1000,1001,1002,1006,1007,1008,1009,1010,1011,1012,1013,1014,1021,1022,1023,1024,1025,1026,1027,1029,1030,1032,1037,1038,1039,1040,1041,1042,1043,1044,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1065,1066,1067,1069,1070,1071,1072,1077,1078,1080,1084,1085,1086,1087,1088,1090,1091,1092,1093,1096,1097,1098,1101,1102,1104,1109,1110,1111,1112,1116,1120,1131,1134,1135,1136,1137,1139,1140,1141,1153,1160,1161,1188,1193,1232,1236,1246,1256,1268,1281,1294,1295,1296,1297,1298,1299,1300,1301,1302,1303,1373,1382,2294,2296,2302,2315,2320,2345,2349,2372,2373,2376,2382,2392,2393,2394,2401,2420,2435,2486,2570,2594,2631,2636,2637,2671,2672,2706,2789,2790,2791,2792,2793,2794,2795,2801,2807,2808,2809,2810,2811,2813,2814,2815,2816,2817,2830,2885,2892,2895,2904,2962,2970,3165,3204,3206,3395,3418,3419,3449,3547,3567,3575,3579,3603,3604,3608,3626,3720,3726,3741,3747,3756,3758,3794,3800,3802,3848,4114,4264,4305,4351,4355}'::bigint[])) AND (mes_ano >= '2018-08-01'::date) AND (mes_ano <= '2019-01-01'::date))
  • Filter: ((motorista_id IS NOT NULL) AND (uo_motorista_id = ANY ('{287,288,326,399,400,420,421,482,842,874,875,876,877,882,885,886,888,889,890,892,894,895,899,900,903,904,905,906,907,908,909,923,924,931,932,933,936,937,938,952,953,954,955,956,957,958,959,960,961,962,964,965,967,968,969,970,972,973,977,980,985,987,988,990,993,995,999,1000,1001,1002,1006,1007,1008,1009,1010,1011,1012,1013,1014,1021,1022,1023,1024,1025,1026,1027,1029,1030,1032,1037,1038,1039,1040,1041,1042,1043,1044,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1065,1066,1067,1069,1070,1071,1072,1077,1078,1080,1084,1085,1086,1087,1088,1090,1091,1092,1093,1096,1097,1098,1101,1102,1104,1109,1110,1111,1112,1116,1120,1131,1134,1135,1136,1137,1139,1140,1141,1153,1160,1161,1188,1193,1232,1236,1246,1256,1268,1281,1294,1295,1296,1297,1298,1299,1300,1301,1302,1303,1373,1382,2294,2296,2302,2315,2320,2345,2349,2372,2373,2376,2382,2392,2393,2394,2401,2420,2435,2486,2570,2594,2631,2636,2637,2671,2672,2706,2789,2790,2791,2792,2793,2794,2795,2801,2807,2808,2809,2810,2811,2813,2814,2815,2816,2817,2830,2885,2892,2895,2904,2962,2970,3165,3204,3206,3395,3418,3419,3449,3547,3567,3575,3579,3603,3604,3608,3626,3720,3726,3741,3747,3756,3758,3794,3800,3802,3848,4114,4264,4305,4351,4355}'::bigint[])))
  • Rows Removed by Filter: 1894
  • Heap Blocks: exact=3686
11. 10.369 10.369 ↓ 1.2 57,985 1

Bitmap Index Scan on idx_2019_01_fat_conducao_mensal_uo_veic (cost=0.00..2,529.23 rows=48,968 width=0) (actual time=10.369..10.369 rows=57,985 loops=1)

  • Index Cond: ((uo_veiculo_id = ANY ('{287,288,326,399,400,420,421,482,842,874,875,876,877,882,885,886,888,889,890,892,894,895,899,900,903,904,905,906,907,908,909,923,924,931,932,933,936,937,938,952,953,954,955,956,957,958,959,960,961,962,964,965,967,968,969,970,972,973,977,980,985,987,988,990,993,995,999,1000,1001,1002,1006,1007,1008,1009,1010,1011,1012,1013,1014,1021,1022,1023,1024,1025,1026,1027,1029,1030,1032,1037,1038,1039,1040,1041,1042,1043,1044,1053,1054,1055,1056,1057,1058,1059,1060,1061,1062,1063,1065,1066,1067,1069,1070,1071,1072,1077,1078,1080,1084,1085,1086,1087,1088,1090,1091,1092,1093,1096,1097,1098,1101,1102,1104,1109,1110,1111,1112,1116,1120,1131,1134,1135,1136,1137,1139,1140,1141,1153,1160,1161,1188,1193,1232,1236,1246,1256,1268,1281,1294,1295,1296,1297,1298,1299,1300,1301,1302,1303,1373,1382,2294,2296,2302,2315,2320,2345,2349,2372,2373,2376,2382,2392,2393,2394,2401,2420,2435,2486,2570,2594,2631,2636,2637,2671,2672,2706,2789,2790,2791,2792,2793,2794,2795,2801,2807,2808,2809,2810,2811,2813,2814,2815,2816,2817,2830,2885,2892,2895,2904,2962,2970,3165,3204,3206,3395,3418,3419,3449,3547,3567,3575,3579,3603,3604,3608,3626,3720,3726,3741,3747,3756,3758,3794,3800,3802,3848,4114,4264,4305,4351,4355}'::bigint[])) AND (mes_ano >= '2018-08-01'::date) AND (mes_ano <= '2019-01-01'::date))