explain.depesz.com

PostgreSQL's explain analyze made readable

Result: BzXG

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.172 10.599 ↑ 16.1 98 1

Sort (cost=334.77..338.72 rows=1,579 width=60) (actual time=10.586..10.599 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.462 10.427 ↑ 16.1 98 1

HashAggregate (cost=215.36..250.89 rows=1,579 width=60) (actual time=9.962..10.427 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. 4.965 4.965 ↓ 1.0 4,773 1

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