explain.depesz.com

PostgreSQL's explain analyze made readable

Result: nrZQ

Settings
# exclusive inclusive rows x rows loops node
1. 0.017 12,432,117.168 ↑ 6.4 31 1

Unique (cost=757,841.47..757,843.93 rows=197 width=27) (actual time=12,432,111.737..12,432,117.168 rows=31 loops=1)

2. 3.926 12,432,117.151 ↑ 6.4 31 1

Group (cost=757,841.47..757,842.95 rows=197 width=27) (actual time=12,432,111.734..12,432,117.151 rows=31 loops=1)

  • Group Key: tid1.tiddsc, tid1.tidid
3. 101.165 12,432,113.225 ↓ 110.3 21,731 1

Sort (cost=757,841.47..757,841.96 rows=197 width=27) (actual time=12,432,111.730..12,432,113.225 rows=21,731 loops=1)

  • Sort Key: tid1.tiddsc, tid1.tidid
  • Sort Method: quicksort Memory: 2,422kB
4. 971,662.117 12,432,012.060 ↓ 110.3 21,731 1

Nested Loop (cost=2.13..757,833.96 rows=197 width=27) (actual time=1,255,058.842..12,432,012.060 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.560 101.675 ↓ 651.0 651 1

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

6. 2.533 80.887 ↓ 651.0 651 1

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

7. 3.707 71.844 ↓ 651.0 651 1

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

8. 4.924 62.278 ↓ 651.0 651 1

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

9. 1.662 48.240 ↓ 325.5 651 1

Nested Loop (cost=0.85..63.03 rows=2 width=20) (actual time=0.061..48.240 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.013..0.016 rows=1 loops=1)

  • Index Cond: (indid = 3,207)
  • Filter: (sehstatus <> 'I'::bpchar)
11. 46.562 46.562 ↓ 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.045..46.562 rows=651 loops=1)

  • Index Cond: ((sehid = sh.sehid) AND (dshcodmunicipio = '2602001'::bpchar))
12. 9.114 9.114 ↑ 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.013..0.014 rows=1 loops=651)

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

Index Scan using detalhetipodadosindicador_pkey on detalhetipodadosindicador tid1 (cost=0.29..0.34 rows=1 width=27) (actual time=0.007..0.009 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. 18.228 18.228 ↑ 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.023..0.028 rows=1 loops=651)

  • Index Cond: (esccodinep = (dsh.dshcod)::text)
  • Heap Fetches: 0
16. 11,460,248.268 11,460,248.268 ↓ 75.0 4,328,662 651

Seq Scan on ts_censo_basico_docente ent (cost=0.00..756,466.64 rows=57,692 width=9) (actual time=0.011..17,604.068 rows=4,328,662 loops=651)

  • Filter: (tp_dependencia = 3)
  • Rows Removed by Filter: 7,209,709
Planning time : 10.862 ms
Execution time : 12,432,117.365 ms