explain.depesz.com

PostgreSQL's explain analyze made readable

Result: g3O9S

Settings
# exclusive inclusive rows x rows loops node
1. 2,051.254 5,449.797 ↑ 21.8 648 1

HashAggregate (cost=62,491.46..62,738.89 rows=14,139 width=40) (actual time=5,449.143..5,449.797 rows=648 loops=1)

  • Group Key: to_char(account_moneys.date_at, 'YYYY-MM-DD HH24'::text)
2. 2,366.327 3,398.543 ↓ 12.9 1,672,087 1

Nested Loop (cost=0.86..61,520.29 rows=129,489 width=40) (actual time=0.052..3,398.543 rows=1,672,087 loops=1)

3. 0.600 0.600 ↓ 1.0 648 1

Index Only Scan using generate_dates_date_at_uindex on generate_dates (cost=0.29..19.28 rows=634 width=8) (actual time=0.015..0.600 rows=648 loops=1)

  • Index Cond: ((date_at >= '2020-01-01 00:00:00'::timestamp without time zone) AND (date_at <= '2020-01-27 23:00:00'::timestamp without time zone))
  • Heap Fetches: 648
4. 1,031.616 1,031.616 ↓ 1.3 2,580 648

Index Only Scan using account_moneys_date_at_btree_index on account_moneys (cost=0.56..76.23 rows=2,026 width=8) (actual time=0.017..1.592 rows=2,580 loops=648)

  • Index Cond: (date_at = generate_dates.date_at)
  • Heap Fetches: 1672087
Planning time : 0.239 ms
Execution time : 5,450.179 ms