explain.depesz.com

PostgreSQL's explain analyze made readable

Result: WNE2 : My Original Query

Settings
# exclusive inclusive rows x rows loops node
1. 1,794,322.124 3,264,759.989 ↓ 1.4 22,241 1

Aggregate (cost=476413999.30..476413999.31 rows=1 width=13) (actual time=3265083.808..3265083.809 rows=1 loops=1)-> Index Scan using log_entries_created_at_idx on log_entries (cost=0.42..476,413,960.49 rows=15,524 width=13) (actual time=361.686..3,264,759.989 rows=22,241 loops=1)

  • Index Cond: ((created_at >= '2015-04-09 00:00:00'::timestamp without time zone) AND (created_at <= '2015-04-09 23:59:59'::timestamp without time zone))
  • Filter: (NOT (SubPlan 1))
  • Rows Removed by Filter: 8206
2.          

SubPlan (for Aggregate (cost=476413999.30..476413999.31 rows=1 width=13) (actual time=3265083.808..3265083.809 rows=1 loops=1)-> Index Scan using log_entries_created_at_idx on log_entries)

3. 1,470,254.388 1,470,437.865 ↑ 1.1 573,493 30,447

Materialize (cost=0.00..29,092.59 rows=638,861 width=13) (actual time=0.003..48.295 rows=573,493 loops=30,447)

4. 183.477 183.477 ↓ 1.0 641,412 1

Seq Scan on log_entries log_entries_1 (cost=0.00..22,778.29 rows=638,861 width=13) (actual time=1.125..183.477 rows=641,412 loops=1)

  • Filter: (created_at < '2015-04-09 00:00:00'::timestamp without time zone)
  • Rows Removed by Filter: 34691
Total runtime : 3,265,092.698 ms