explain.depesz.com

PostgreSQL's explain analyze made readable

Result: IBgW

Settings
# exclusive inclusive rows x rows loops node
1. 70,036.686 202,610.741 ↑ 1.0 11 1

GroupAggregate (cost=30,080,340.94..31,302,108.95 rows=11 width=48) (actual time=156,680.652..202,610.741 rows=11 loops=1)

  • Group Key: "*VALUES*".column1, "*VALUES*".column2
2. 63,915.687 132,574.055 ↓ 1.6 159,361,324 1

Sort (cost=30,080,340.94..30,324,694.51 rows=97,741,430 width=22) (actual time=109,939.435..132,574.055 rows=159,361,324 loops=1)

  • Sort Key: "*VALUES*".column1, "*VALUES*".column2
  • Sort Method: external merge Disk: 5,302,192kB
3. 0.000 68,658.368 ↓ 1.6 159,361,324 1

Gather (cost=1,000.00..15,934,804.40 rows=97,741,430 width=22) (actual time=1.171..68,658.368 rows=159,361,324 loops=1)

  • Workers Planned: 8
  • Workers Launched: 8
4. 13,225.005 70,192.427 ↓ 1.4 17,706,814 9 / 9

Nested Loop Left Join (cost=0.00..6,159,661.40 rows=12,217,679 width=22) (actual time=0.250..70,192.427 rows=17,706,814 loops=9)

  • Join Filter: ((('2020-04-30'::date - his.conparhisdatven) >= "*VALUES*".column1) AND (('2020-04-30'::date - his.conparhisdatven) <= "*VALUES*".column2))
  • Rows Removed by Join Filter: 80,723,433
5. 21,174.605 21,174.605 ↑ 1.1 8,948,204 9 / 9

Parallel Seq Scan on contrato_parcela_historico his (cost=0.00..2,585,990.23 rows=9,996,283 width=18) (actual time=0.227..21,174.605 rows=8,948,204 loops=9)

  • Filter: (conparhiscarcod = 120)
  • Rows Removed by Filter: 13,280,576
6. 35,792.817 35,792.817 ↑ 1.0 11 80,533,838 / 9

Values Scan on "*VALUES*" (cost=0.00..0.14 rows=11 width=8) (actual time=0.000..0.004 rows=11 loops=80,533,838)

Planning time : 0.314 ms
Execution time : 203,607.346 ms