explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 146S : Optimization for: plan #BzXG

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.223 11.029 ↑ 16.1 98 1

Sort (cost=350.56..354.51 rows=1,579 width=60) (actual time=11.014..11.029 rows=98 loops=1)

  • Sort Key: (date_part('year'::text, (expenses.date)::timestamp without time zone)) DESC, (date_part('month'::text, (expenses.date)::timestamp without time zone)) DESC, expenses.person_id, expenses.beneficiary_id
  • Sort Method: quicksort Memory: 32kB
2. 5.723 10.806 ↑ 16.1 98 1

HashAggregate (cost=215.36..250.89 rows=1,579 width=60) (actual time=10.208..10.806 rows=98 loops=1)

  • Group Key: date_part('year'::text, (expenses.date)::timestamp without time zone), date_part('month'::text, (expenses.date)::timestamp without time zone), expenses.person_id, expenses.beneficiary_id
  • Filter: (min(expenses.date) > (now() - '2 years'::interval))
  • Rows Removed by Filter: 214
3. 5.083 5.083 ↓ 1.0 4,773 1

Seq Scan on expenses (cost=0.00..133.06 rows=4,703 width=33) (actual time=0.023..5.083 rows=4,773 loops=1)

Planning time : 0.424 ms
Execution time : 11.186 ms