explain.depesz.com

PostgreSQL's explain analyze made readable

Result: HdpE

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 31.164 224,137.421 ↑ 1.0 500,000 1

Limit (cost=4,443,935.44..4,445,185.44 rows=500,000 width=252) (actual time=223,942.963..224,137.421 rows=500,000 loops=1)

2. 102,535.113 224,106.257 ↑ 13.6 500,000 1

Sort (cost=4,443,935.44..4,460,941.17 rows=6,802,295 width=252) (actual time=223,942.961..224,106.257 rows=500,000 loops=1)

  • Sort Key: (random())
  • Sort Method: external merge Disk: 990,728kB
3. 9,884.302 121,571.144 ↓ 1.1 7,629,673 1

Hash Join (cost=1,128.45..1,230,696.42 rows=6,802,295 width=252) (actual time=29.396..121,571.144 rows=7,629,673 loops=1)

  • Hash Cond: (persona.id_centro = centro.id)
4. 111,657.783 111,657.783 ↓ 1.1 7,630,127 1

Seq Scan on persona (cost=0.00..1,118,713.60 rows=6,886,847 width=41) (actual time=0.042..111,657.783 rows=7,630,127 loops=1)

  • Filter: ((celular_prioritario IS NOT NULL) AND elector_activo AND (estrato_2017 = 'E'::text))
  • Rows Removed by Filter: 12,707,050
5. 10.171 29.059 ↑ 1.0 14,642 1

Hash (cost=945.43..945.43 rows=14,642 width=211) (actual time=29.059..29.059 rows=14,642 loops=1)

  • Buckets: 16,384 Batches: 1 Memory Usage: 1,661kB
6. 8.340 18.888 ↑ 1.0 14,642 1

Hash Join (cost=87.86..945.43 rows=14,642 width=211) (actual time=3.367..18.888 rows=14,642 loops=1)

  • Hash Cond: (centro.id_parr = parroquia.id)
7. 7.245 7.245 ↑ 1.0 14,642 1

Seq Scan on centro (cost=0.00..656.24 rows=14,642 width=47) (actual time=0.018..7.245 rows=14,642 loops=1)

  • Filter: activo
  • Rows Removed by Filter: 182
8. 0.964 3.303 ↑ 1.0 1,268 1

Hash (cost=72.01..72.01 rows=1,268 width=172) (actual time=3.303..3.303 rows=1,268 loops=1)

  • Buckets: 2,048 Batches: 1 Memory Usage: 102kB
9. 1.076 2.339 ↑ 1.0 1,268 1

Hash Join (cost=19.90..72.01 rows=1,268 width=172) (actual time=0.970..2.339 rows=1,268 loops=1)

  • Hash Cond: (parroquia.id_mun = municipio.id)
10. 0.336 0.336 ↑ 1.0 1,268 1

Seq Scan on parroquia (cost=0.00..34.68 rows=1,268 width=19) (actual time=0.009..0.336 rows=1,268 loops=1)

11. 0.331 0.927 ↑ 1.0 423 1

Hash (cost=14.61..14.61 rows=423 width=161) (actual time=0.927..0.927 rows=423 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 33kB
12. 0.428 0.596 ↑ 1.0 423 1

Hash Join (cost=1.56..14.61 rows=423 width=161) (actual time=0.082..0.596 rows=423 loops=1)

  • Hash Cond: (municipio.id_edo = estado.id)
13. 0.129 0.129 ↑ 1.0 423 1

Seq Scan on municipio (cost=0.00..7.23 rows=423 width=19) (actual time=0.014..0.129 rows=423 loops=1)

14. 0.021 0.039 ↑ 1.0 25 1

Hash (cost=1.25..1.25 rows=25 width=150) (actual time=0.039..0.039 rows=25 loops=1)

  • Buckets: 1,024 Batches: 1 Memory Usage: 10kB
15. 0.018 0.018 ↑ 1.0 25 1

Seq Scan on estado (cost=0.00..1.25 rows=25 width=150) (actual time=0.007..0.018 rows=25 loops=1)

Planning time : 2.335 ms
Execution time : 224,370.831 ms