explain.depesz.com

PostgreSQL's explain analyze made readable

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

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.094 6.385 ↑ 26.3 110 1

Sort (cost=639.32..646.54 rows=2,888 width=81) (actual time=6.369..6.385 rows=110 loops=1)

  • Sort Key: (date(ps.create_date)) DESC, (sum(psp.total_paid_amount)), psp.id_payment_type
  • Sort Method: quicksort Memory: 36kB
2. 0.410 6.291 ↑ 26.3 110 1

HashAggregate (cost=365.02..473.32 rows=2,888 width=81) (actual time=6.159..6.291 rows=110 loops=1)

  • Group Key: ps.id_seller, date(ps.create_date), psp.id_payment_type
3. 0.265 5.881 ↑ 17.1 169 1

Hash Join (cost=122.15..336.14 rows=2,888 width=31) (actual time=2.263..5.881 rows=169 loops=1)

  • Hash Cond: (ps.id = psp.id_physical_sale)
4. 3.404 3.404 ↑ 24.2 169 1

Seq Scan on physical_sale ps (cost=0.00..162.55 rows=4,091 width=16) (actual time=0.026..3.404 rows=169 loops=1)

  • Filter: ((id_seller = 153) AND (create_date > date_trunc('day'::text, (now() - '30 days'::interval day))))
  • Rows Removed by Filter: 2797
5. 0.857 2.212 ↑ 1.0 2,966 1

Hash (cost=85.08..85.08 rows=2,966 width=19) (actual time=2.212..2.212 rows=2,966 loops=1)

  • Buckets: 4096 Batches: 1 Memory Usage: 188kB
6. 1.355 1.355 ↑ 1.0 2,966 1

Seq Scan on physical_sale_payment psp (cost=0.00..85.08 rows=2,966 width=19) (actual time=0.005..1.355 rows=2,966 loops=1)

  • Filter: (status = 'APPROVED'::text)
Planning time : 0.312 ms
Execution time : 6.482 ms