explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 5Iv : Optimization for: plan #8x6nX

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 37,238.591 37,238.591 ↑ 1.0 111,260 1

CTE Scan on ponto (cost=285,443.98..326,104.25 rows=111,398 width=236) (actual time=621.654..37,238.591 rows=111,260 loops=1)

2.          

CTE ponto

3. 34,827.117 35,518.834 ↑ 1.0 111,260 1

Result (cost=50,394.20..285,443.98 rows=111,398 width=180) (actual time=621.636..35,518.834 rows=111,260 loops=1)

4. 194.899 691.717 ↑ 1.0 111,260 1

Sort (cost=50,394.20..50,672.70 rows=111,398 width=124) (actual time=621.105..691.717 rows=111,260 loops=1)

  • Sort Key: pontos.user_id, pontos.dt_ponto
  • Sort Method: external sort Disk: 9416kB
5. 106.042 496.818 ↑ 1.0 111,260 1

WindowAgg (cost=26,580.69..33,821.56 rows=111,398 width=124) (actual time=271.919..496.818 rows=111,260 loops=1)

6. 87.814 390.776 ↑ 1.0 111,260 1

WindowAgg (cost=26,580.69..29,922.63 rows=111,398 width=40) (actual time=271.914..390.776 rows=111,260 loops=1)

7. 141.280 302.962 ↑ 1.0 111,260 1

Sort (cost=26,580.69..26,859.19 rows=111,398 width=36) (actual time=271.909..302.962 rows=111,260 loops=1)

  • Sort Key: pontos.user_id, ((pontos.dt_ponto)::date)
  • Sort Method: external sort Disk: 5432kB
8. 84.472 161.682 ↑ 1.0 111,260 1

WindowAgg (cost=0.42..14,194.05 rows=111,398 width=36) (actual time=0.019..161.682 rows=111,260 loops=1)

9. 77.210 77.210 ↑ 1.0 111,260 1

Index Scan using ind_pontos_user_id_dt_ponto on pontos (cost=0.42..11,687.60 rows=111,398 width=28) (actual time=0.015..77.210 rows=111,260 loops=1)

  • Filter: situacao
  • Rows Removed by Filter: 754
Planning time : 0.370 ms