explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jGGv

Settings
# exclusive inclusive rows x rows loops node
1. 38.256 440.849 ↓ 4.9 197,746 1

Unique (cost=114,154.52..118,170.24 rows=40,000 width=32) (actual time=328.160..440.849 rows=197,746 loops=1)

2. 252.474 402.593 ↑ 1.0 529,138 1

Sort (cost=114,154.52..115,493.09 rows=535,430 width=32) (actual time=328.159..402.593 rows=529,138 loops=1)

  • Sort Key: medicaoindicador_201909.unidadenegocioid, medicaoindicador_201909.indicadorid, medicaoindicador_201909.data DESC
  • Sort Method: external merge Disk: 21776kB
3. 25.097 150.119 ↑ 1.0 529,138 1

Append (cost=0.42..50,393.95 rows=535,430 width=32) (actual time=59.002..150.119 rows=529,138 loops=1)

  • Subplans Removed: 11
4. 67.112 124.952 ↑ 1.0 528,931 1

Bitmap Heap Scan on medicaoindicador_201909 (cost=14,764.34..47,629.59 rows=535,214 width=32) (actual time=59.001..124.952 rows=528,931 loops=1)

  • Recheck Cond: (data >= (now() - '3 days'::interval))
  • Heap Blocks: exact=8286
5. 57.840 57.840 ↑ 1.0 528,931 1

Bitmap Index Scan on medicaoindicador_201909_data_unidadenegocioid_indicadorid_idx (cost=0.00..14,630.54 rows=535,214 width=0) (actual time=57.840..57.840 rows=528,931 loops=1)

  • Index Cond: (data >= (now() - '3 days'::interval))
6. 0.010 0.010 ↓ 3.0 3 1

Seq Scan on medicaoindicador_202006 (cost=0.00..1.05 rows=1 width=32) (actual time=0.009..0.010 rows=3 loops=1)

  • Filter: (data >= (now() - '3 days'::interval))
7. 0.060 0.060 ↑ 1.0 204 1

Seq Scan on medicaoindicador_202007 (cost=0.00..6.57 rows=204 width=32) (actual time=0.004..0.060 rows=204 loops=1)

  • Filter: (data >= (now() - '3 days'::interval))
Planning time : 0.919 ms
Execution time : 451.867 ms