explain.depesz.com

PostgreSQL's explain analyze made readable

Result: uePu

Settings
# exclusive inclusive rows x rows loops node
1. 0.517 295,330.435 ↓ 53.0 53 1

Sort (cost=53,986.23..53,986.23 rows=1 width=361) (actual time=295,330.413..295,330.435 rows=53 loops=1)

  • Sort Key: p_e.datacriacao
  • Sort Method: quicksort Memory: 360kB
2. 6,159.155 295,329.918 ↓ 53.0 53 1

Nested Loop Left Join (cost=42,855.19..53,986.22 rows=1 width=361) (actual time=5,815.121..295,329.918 rows=53 loops=1)

  • Join Filter: (pexinscricaoevento.idevento = p_e.id)
  • Rows Removed by Join Filter: 5402291
3. 0.415 275,144.313 ↓ 53.0 53 1

Nested Loop (cost=34,198.28..44,477.05 rows=1 width=353) (actual time=4,487.869..275,144.313 rows=53 loops=1)

4. 6,307.153 275,142.838 ↓ 53.0 53 1

Nested Loop Left Join (cost=34,198.15..44,476.29 rows=1 width=321) (actual time=4,487.845..275,142.838 rows=53 loops=1)

  • Join Filter: (p_cev_1.idevento = p_e.id)
  • Rows Removed by Join Filter: 5331164
5. 3.120 1,040.677 ↓ 53.0 53 1

Nested Loop (cost=0.42..6,400.05 rows=1 width=289) (actual time=81.541..1,040.677 rows=53 loops=1)

6. 994.811 994.811 ↓ 97.2 1,943 1

Seq Scan on pexevento p_e (cost=0.00..6,231.00 rows=20 width=289) (actual time=0.053..994.811 rows=1,943 loops=1)

  • Filter: ((dataexclusao IS NULL) AND (habilitado OR (idusuariocriacao = 249)) AND (datacriacao > '2016-01-01 00:00:00-03'::timestamp with time zone) AND ((titulo)::text ~~* concat('%', 'Minicurso', '%')) AND (idinstituicaoensino = COALESCE(NULLIF(4, 0), (idinstituicaoensino)::integer)))
  • Rows Removed by Filter: 103875
7. 42.746 42.746 ↓ 0.0 0 1,943

Index Only Scan using uk_pexcursoevento on pexcursoevento p_cev (cost=0.42..8.44 rows=1 width=8) (actual time=0.022..0.022 rows=0 loops=1,943)

  • Index Cond: ((idcurso = 99) AND (idevento = p_e.id))
  • Heap Fetches: 53
8. 243,130.822 267,795.008 ↓ 3.2 100,589 53

GroupAggregate (cost=34,197.73..37,360.54 rows=31,809 width=52) (actual time=42.169..5,052.736 rows=100,589 loops=53)

  • Group Key: p_cev_1.idevento
9. 23,810.047 24,664.186 ↑ 1.0 221,216 53

Sort (cost=34,197.73..34,750.77 rows=221,216 width=52) (actual time=41.621..465.362 rows=221,216 loops=53)

  • Sort Key: p_cev_1.idevento
  • Sort Method: external sort Disk: 12344kB
10. 518.391 854.139 ↑ 1.0 221,216 1

Hash Join (cost=55.27..6,995.67 rows=221,216 width=52) (actual time=1.151..854.139 rows=221,216 loops=1)

  • Hash Cond: (p_cev_1.idcurso = c.id)
11. 334.619 334.619 ↑ 1.0 221,216 1

Seq Scan on pexcursoevento p_cev_1 (cost=0.00..3,622.16 rows=221,216 width=18) (actual time=0.006..334.619 rows=221,216 loops=1)

12. 0.613 1.129 ↑ 1.0 1,701 1

Hash (cost=34.01..34.01 rows=1,701 width=36) (actual time=1.129..1.129 rows=1,701 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 114kB
13. 0.516 0.516 ↑ 1.0 1,701 1

Seq Scan on curso_sync c (cost=0.00..34.01 rows=1,701 width=36) (actual time=0.006..0.516 rows=1,701 loops=1)

14. 1.060 1.060 ↑ 1.0 1 53

Index Scan using pk_instituicaoensino_sync on instituicaoensino_sync ie_sync (cost=0.14..0.75 rows=1 width=34) (actual time=0.015..0.020 rows=1 loops=53)

  • Index Cond: (id = p_e.idinstituicaoensino)
15. 13,657.069 14,026.450 ↓ 3.9 101,931 53

HashAggregate (cost=8,656.91..8,919.14 rows=26,223 width=16) (actual time=23.416..264.650 rows=101,931 loops=53)

  • Group Key: pexinscricaoevento.idevento
16. 369.381 369.381 ↑ 1.0 370,994 1

Seq Scan on pexinscricaoevento (cost=0.00..6,801.94 rows=370,994 width=16) (actual time=0.007..369.381 rows=370,994 loops=1)

Planning time : 1.559 ms
Execution time : 295,341.116 ms