explain.depesz.com

PostgreSQL's explain analyze made readable

Result: fkj4

Settings
# exclusive inclusive rows x rows loops node
1. 0.015 12,071,281.838 ↑ 6.7 31 1

Unique (cost=766,751.10..766,753.71 rows=209 width=27) (actual time=12,071,276.713..12,071,281.838 rows=31 loops=1)

2. 3.786 12,071,281.823 ↑ 6.7 31 1

Group (cost=766,751.10..766,752.67 rows=209 width=27) (actual time=12,071,276.711..12,071,281.823 rows=31 loops=1)

  • Group Key: tid1.tiddsc, tid1.tidid
3. 99.965 12,071,278.037 ↓ 104.0 21,731 1

Sort (cost=766,751.10..766,751.62 rows=209 width=27) (actual time=12,071,276.708..12,071,278.037 rows=21,731 loops=1)

  • Sort Key: tid1.tiddsc, tid1.tidid
  • Sort Method: quicksort Memory: 2,422kB
4. 924,333.403 12,071,178.072 ↓ 104.0 21,731 1

Nested Loop (cost=2.13..766,743.05 rows=209 width=27) (actual time=1,130,816.738..12,071,178.072 rows=21,731 loops=1)

  • Join Filter: ((dsh.dshcod)::bigint = (ent.co_entidade)::bigint)
  • Rows Removed by Join Filter: 2,817,937,231
5. 2.604 290.516 ↓ 651.0 651 1

Nested Loop (cost=2.13..69.26 rows=1 width=35) (actual time=1.124..290.516 rows=651 loops=1)

6. 2.783 248.201 ↓ 651.0 651 1

Nested Loop (cost=1.71..68.34 rows=1 width=35) (actual time=0.795..248.201 rows=651 loops=1)

7. 3.209 238.908 ↓ 651.0 651 1

Nested Loop (cost=1.43..64.03 rows=1 width=39) (actual time=0.496..238.908 rows=651 loops=1)

8. 6.433 230.491 ↓ 651.0 651 1

Nested Loop (cost=1.14..63.68 rows=1 width=16) (actual time=0.481..230.491 rows=651 loops=1)

9. 1.989 212.991 ↓ 325.5 651 1

Nested Loop (cost=0.85..63.03 rows=2 width=20) (actual time=0.060..212.991 rows=651 loops=1)

10. 0.016 0.016 ↑ 4.0 1 1

Index Scan using ix_seriehistorica_indid on seriehistorica sh (cost=0.29..18.15 rows=4 width=8) (actual time=0.014..0.016 rows=1 loops=1)

  • Index Cond: (indid = 3,207)
  • Filter: (sehstatus <> 'I'::bpchar)
11. 210.986 210.986 ↓ 325.5 651 1

Index Scan using ix_detalheserirhistorica_sehiddshcodmunicipio on detalheseriehistorica dsh (cost=0.57..11.20 rows=2 width=20) (actual time=0.042..210.986 rows=651 loops=1)

  • Index Cond: ((sehid = sh.sehid) AND (dshcodmunicipio = '2602001'::bpchar))
12. 11.067 11.067 ↑ 1.0 1 651

Index Only Scan using detalhetipodadosindicador_pkey on detalhetipodadosindicador tid2 (cost=0.29..0.31 rows=1 width=4) (actual time=0.016..0.017 rows=1 loops=651)

  • Index Cond: (tidid = dsh.tidid2)
  • Heap Fetches: 0
13. 5.208 5.208 ↑ 1.0 1 651

Index Scan using detalhetipodadosindicador_pkey on detalhetipodadosindicador tid1 (cost=0.29..0.34 rows=1 width=27) (actual time=0.005..0.008 rows=1 loops=651)

  • Index Cond: (tidid = dsh.tidid1)
14. 6.510 6.510 ↑ 1.0 1 651

Index Only Scan using ix_detalheperiodicidade_dpeid on detalheperiodicidade dpe (cost=0.28..4.30 rows=1 width=4) (actual time=0.008..0.010 rows=1 loops=651)

  • Index Cond: (dpeid = sh.dpeid)
  • Heap Fetches: 0
15. 39.711 39.711 ↑ 1.0 1 651

Index Only Scan using escola_pkey on escola esc (cost=0.42..0.91 rows=1 width=9) (actual time=0.056..0.061 rows=1 loops=651)

  • Index Cond: (esccodinep = (dsh.dshcod)::text)
  • Heap Fetches: 0
16. 11,146,554.153 11,146,554.153 ↓ 70.7 4,328,662 651

Seq Scan on ts_censo_basico_docente ent (cost=0.00..765,296.25 rows=61,224 width=9) (actual time=0.014..17,122.203 rows=4,328,662 loops=651)

  • Filter: (tp_dependencia = 3)
  • Rows Removed by Filter: 7,209,709
Planning time : 38.861 ms
Execution time : 12,071,282.909 ms