explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 0gQn

Settings
# exclusive inclusive rows x rows loops node
1. 0.842 47.520 ↑ 1.0 1 1

Nested Loop (cost=578.00..2,440.34 rows=1 width=53) (actual time=19.019..47.520 rows=1 loops=1)

2. 1.204 41.828 ↑ 1.0 970 1

Nested Loop (cost=578.00..2,110.26 rows=987 width=46) (actual time=18.850..41.828 rows=970 loops=1)

3. 1.716 35.774 ↑ 1.0 970 1

Hash Join (cost=578.00..1,644.68 rows=987 width=31) (actual time=18.825..35.774 rows=970 loops=1)

  • Hash Cond: (c.fk_motorista_id = m.id)
4. 15.313 15.313 ↑ 1.0 970 1

Seq Scan on cartao c (cost=0.00..1,042.00 rows=987 width=31) (actual time=0.030..15.313 rows=970 loops=1)

  • Filter: (validade >= '1990-09-03'::date)
5. 10.195 18.745 ↑ 1.0 20,000 1

Hash (cost=328.00..328.00 rows=20,000 width=8) (actual time=18.745..18.745 rows=20,000 loops=1)

  • Buckets: 2048 Batches: 1 Memory Usage: 625kB
6. 8.550 8.550 ↑ 1.0 20,000 1

Seq Scan on motorista m (cost=0.00..328.00 rows=20,000 width=8) (actual time=0.010..8.550 rows=20,000 loops=1)

7. 4.850 4.850 ↑ 1.0 1 970

Index Scan using pessoa_fisica_pkey on pessoa_fisica fis (cost=0.00..0.46 rows=1 width=23) (actual time=0.005..0.005 rows=1 loops=970)

  • Index Cond: (fis.id = m.fk_pessoa_fisica_id)
8. 4.850 4.850 ↓ 0.0 0 970

Index Scan using pessoa_pkey on pessoa pes (cost=0.00..0.32 rows=1 width=15) (actual time=0.005..0.005 rows=0 loops=970)

  • Index Cond: (pes.id = fis.fk_pessoa_id)
  • Filter: ((pes.nome)::text = 'cxxks-nome'::text)