explain.depesz.com

PostgreSQL's explain analyze made readable

Result: jiGg : Optimization for: Optimization for: plan #NUN; plan #fMba

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.023 0.252 ↑ 1.0 9 1

Sort (cost=5.12..5.14 rows=9 width=81) (actual time=0.250..0.252 rows=9 loops=1)

  • Sort Key: (date(ps.create_date)) DESC, (sum(psp.total_paid_amount)), psp.id_payment_type
  • Sort Method: quicksort Memory: 26kB
2. 0.061 0.229 ↑ 1.0 9 1

HashAggregate (cost=4.64..4.98 rows=9 width=81) (actual time=0.202..0.229 rows=9 loops=1)

  • Group Key: ps.id_seller, date(ps.create_date), psp.id_payment_type
3. 0.031 0.168 ↓ 1.1 10 1

Hash Join (cost=2.46..4.55 rows=9 width=31) (actual time=0.112..0.168 rows=10 loops=1)

  • Hash Cond: (psp.id_physical_sale = ps.id)
4. 0.054 0.054 ↑ 1.0 60 1

Seq Scan on physical_sale_payment psp (cost=0.00..1.75 rows=60 width=19) (actual time=0.016..0.054 rows=60 loops=1)

  • Filter: (status = 'APPROVED'::text)
5. 0.007 0.083 ↓ 1.1 10 1

Hash (cost=2.35..2.35 rows=9 width=16) (actual time=0.083..0.083 rows=10 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
6. 0.076 0.076 ↓ 1.1 10 1

Seq Scan on physical_sale ps (cost=0.00..2.35 rows=9 width=16) (actual time=0.023..0.076 rows=10 loops=1)

  • Filter: ((id_seller = 153) AND (create_date > date_trunc('day'::text, (now() - '30 days'::interval day))))
  • Rows Removed by Filter: 50
Planning time : 0.774 ms
Execution time : 0.341 ms