explain.depesz.com

PostgreSQL's explain analyze made readable

Result: NUN

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.042 0.316 ↑ 1.0 9 1

Sort (cost=5.12..5.14 rows=9 width=81) (actual time=0.315..0.316 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.073 0.274 ↑ 1.0 9 1

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

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

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

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

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

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

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

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

Seq Scan on physical_sale ps (cost=0.00..2.35 rows=9 width=16) (actual time=0.025..0.103 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.951 ms
Execution time : 0.399 ms