explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DShj

Settings
# exclusive inclusive rows x rows loops node
1. 81.280 1,567.070 ↓ 19.8 43,834 1

WindowAgg (cost=357,632.33..357,676.53 rows=2,210 width=47) (actual time=1,458.644..1,567.070 rows=43,834 loops=1)

2. 104.947 1,485.790 ↓ 19.8 43,834 1

Sort (cost=357,632.33..357,637.85 rows=2,210 width=35) (actual time=1,458.624..1,485.790 rows=43,834 loops=1)

  • Sort Key: vw.femea_id, vw.data_hora_cobertura DESC
  • Sort Method: quicksort Memory: 4961kB
3. 75.614 1,380.843 ↓ 19.8 43,834 1

Gather (cost=1,000.99..357,509.57 rows=2,210 width=35) (actual time=575.328..1,380.843 rows=43,834 loops=1)

  • Workers Planned: 3
  • Workers Launched: 3
4. 214.707 1,305.229 ↓ 15.4 10,958 4

Nested Loop (cost=0.99..356,288.57 rows=713 width=35) (actual time=510.514..1,305.229 rows=10,958 loops=4)

5. 1,090.507 1,090.507 ↓ 17.0 12,249 4

Parallel Index Scan using vw_modelo_reprodutivo_parto_id_idx on vw_modelo_reprodutivo vw (cost=0.56..354,405.04 rows=720 width=35) (actual time=510.442..1,090.507 rows=12,249 loops=4)

  • Index Cond: (contrato_id = 16)
  • Filter: ((((data_hora_cobertura + '270 days'::interval day) >= '2019-06-01'::date) AND ((data_hora_cobertura + '270 days'::interval day) <= '2020-02-29'::date)) OR (((data_hora_cobertura + '315 days'::interval day) >= '2019-06-01'::date) AND ((data_hora_cobertura + '315 days'::interval day) <= '2020-02-29'::date)))
  • Rows Removed by Filter: 41890
6. 0.015 0.015 ↑ 1.0 1 48,997

Index Scan using mbw_animal_pkey on mbw_animal a (cost=0.43..2.62 rows=1 width=4) (actual time=0.015..0.015 rows=1 loops=48,997)

  • Index Cond: (id = vw.femea_id)
  • Filter: ((data_descarte_reprodutor IS NULL) OR (data_descarte_reprodutor > '2019-11-10'::date))
  • Rows Removed by Filter: 0
Planning time : 0.874 ms
Execution time : 1,573.202 ms