explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 34Wj

Settings
# exclusive inclusive rows x rows loops node
1. 109.886 44,039.099 ↓ 8,749.0 8,749 1

Nested Loop (cost=9,777.20..14,880.79 rows=1 width=20) (actual time=114.404..44,039.099 rows=8,749 loops=1)

2.          

CTE last_collected

3. 40.615 74.391 ↓ 265.1 8,749 1

HashAggregate (cost=9,617.73..9,618.06 rows=33 width=12) (actual time=61.500..74.391 rows=8,749 loops=1)

  • Group Key: cgps.u_codcliente
4. 33.776 33.776 ↓ 1.1 11,028 1

Index Scan using cgps_s_relativo_s_cnpj_cpf_data_salvo on cgps (cost=0.55..9,568.45 rows=9,856 width=12) (actual time=0.023..33.776 rows=11,028 loops=1)

  • Index Cond: (s_relativo = 'COLETA WEB'::text)
5. 39.647 131.719 ↓ 265.1 8,749 1

HashAggregate (cost=0.83..1.16 rows=33 width=12) (actual time=112.071..131.719 rows=8,749 loops=1)

  • Group Key: t1_1.u_codcliente, t1_1.t_data_coleta
6. 92.072 92.072 ↓ 265.1 8,749 1

CTE Scan on last_collected t1_1 (cost=0.00..0.66 rows=33 width=12) (actual time=61.503..92.072 rows=8,749 loops=1)

7. 227.474 43,797.494 ↑ 1.0 1 8,749

Bitmap Heap Scan on cgps t2_1 (cost=158.31..159.43 rows=1 width=28) (actual time=5.003..5.006 rows=1 loops=8,749)

  • Recheck Cond: ((u_codcliente = t1_1.u_codcliente) AND (s_relativo = 'COLETA WEB'::text))
  • Filter: (t1_1.t_data_coleta = t_data_coleta)
  • Rows Removed by Filter: 0
  • Heap Blocks: exact=9556
8. 682.422 43,570.020 ↓ 0.0 0 8,749

BitmapAnd (cost=158.31..158.31 rows=1 width=0) (actual time=4.980..4.980 rows=0 loops=8,749)

9. 594.932 594.932 ↑ 1.6 125 8,749

Bitmap Index Scan on cgps_u_codcliente (cost=0.00..3.03 rows=200 width=0) (actual time=0.068..0.068 rows=125 loops=8,749)

  • Index Cond: (u_codcliente = t1_1.u_codcliente)
10. 42,292.666 42,292.666 ↓ 1.1 11,028 8,749

Bitmap Index Scan on cgps_s_relativo_s_cnpj_cpf_data_salvo (cost=0.00..152.57 rows=9,856 width=0) (actual time=4.834..4.834 rows=11,028 loops=8,749)

  • Index Cond: (s_relativo = 'COLETA WEB'::text)