explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 4t0

Settings
# exclusive inclusive rows x rows loops node
1. 4,433.737 5,093.016 ↓ 1.1 49,900 1

GroupAggregate (cost=38,937.02..40,906.40 rows=44,530 width=48) (actual time=600.140..5,093.016 rows=49,900 loops=1)

  • Group Key: vpr.vendas_id
2. 184.676 659.279 ↓ 1.0 121,099 1

Sort (cost=38,937.02..39,234.55 rows=119,010 width=55) (actual time=599.882..659.279 rows=121,099 loops=1)

  • Sort Key: vpr.vendas_id
  • Sort Method: external merge Disk: 7840kB
3. 112.581 474.603 ↓ 1.0 121,099 1

Hash Join (cost=15,342.68..24,833.55 rows=119,010 width=55) (actual time=208.159..474.603 rows=121,099 loops=1)

  • Hash Cond: (vpp.pessoa_id = ps.pessoa_id)
4. 114.432 310.024 ↓ 1.0 121,099 1

Hash Join (cost=9,011.84..16,023.29 rows=119,010 width=32) (actual time=155.775..310.024 rows=121,099 loops=1)

  • Hash Cond: (vpp.vendas_produtos_id = vpr.vendas_produtos_id)
5. 40.101 40.101 ↓ 1.0 121,229 1

Seq Scan on vendas_produtos_passageiros vpp (cost=0.00..4,623.22 rows=121,222 width=32) (actual time=0.016..40.101 rows=121,229 loops=1)

6. 26.946 155.491 ↓ 1.0 61,310 1

Hash (cost=7,846.64..7,846.64 rows=60,256 width=32) (actual time=155.490..155.491 rows=61,310 loops=1)

  • Buckets: 65536 Batches: 2 Memory Usage: 2446kB
7. 128.545 128.545 ↓ 1.0 61,310 1

Seq Scan on vendas_produtos vpr (cost=0.00..7,846.64 rows=60,256 width=32) (actual time=0.087..128.545 rows=61,310 loops=1)

  • Filter: ((status = 0) OR (status = 1))
  • Rows Removed by Filter: 62
8. 28.070 51.998 ↑ 1.0 68,910 1

Hash (cost=4,930.26..4,930.26 rows=68,926 width=39) (actual time=51.997..51.998 rows=68,910 loops=1)

  • Buckets: 65536 Batches: 2 Memory Usage: 2918kB
9. 23.928 23.928 ↑ 1.0 68,910 1

Seq Scan on pessoa ps (cost=0.00..4,930.26 rows=68,926 width=39) (actual time=0.027..23.928 rows=68,910 loops=1)

Planning time : 1.382 ms