explain.depesz.com

PostgreSQL's explain analyze made readable

Result: JIux

Settings
# exclusive inclusive rows x rows loops node
1. 52.791 19,044.886 ↑ 4.2 42,678 1

GroupAggregate (cost=3,727,963.48..3,759,893.87 rows=179,740 width=15) (actual time=18,956.922..19,044.886 rows=42,678 loops=1)

  • Group Key: acts.case_file_id, acts.state
2. 152.519 18,992.095 ↑ 23.4 128,986 1

Sort (cost=3,727,963.48..3,735,496.73 rows=3,013,299 width=15) (actual time=18,956.914..18,992.095 rows=128,986 loops=1)

  • Sort Key: acts.case_file_id, acts.state
  • Sort Method: external sort Disk: 3280kB
3. 488.680 18,839.576 ↑ 23.4 128,986 1

Merge Join (cost=3,228,530.19..3,300,690.63 rows=3,013,299 width=15) (actual time=15,357.389..18,839.576 rows=128,986 loops=1)

  • Merge Cond: (activities.case_file_id = acts.case_file_id)
4. 609.781 9,168.486 ↑ 7.7 23,448 1

GroupAggregate (cost=1,623,480.59..1,643,701.31 rows=179,740 width=35) (actual time=7,726.681..9,168.486 rows=23,448 loops=1)

  • Group Key: activities.case_file_id, activities.type
  • Filter: (max(activities.updated_at) > '2019-11-01 00:00:00'::timestamp without time zone)
  • Rows Removed by Filter: 251005
5. 2,710.330 8,558.705 ↓ 1.0 1,816,689 1

Sort (cost=1,623,480.59..1,627,974.09 rows=1,797,397 width=35) (actual time=7,719.262..8,558.705 rows=1,816,689 loops=1)

  • Sort Key: activities.case_file_id, activities.type
  • Sort Method: external merge Disk: 74528kB
6. 5,848.375 5,848.375 ↓ 1.0 1,816,689 1

Seq Scan on activities (cost=0.00..1,387,603.21 rows=1,797,397 width=35) (actual time=0.023..5,848.375 rows=1,816,689 loops=1)

  • Filter: ((type)::text = 'SendEmailActivity'::text)
  • Rows Removed by Filter: 9967922
7. 745.526 9,182.410 ↓ 1.0 1,815,979 1

Materialize (cost=1,605,049.59..1,614,036.58 rows=1,797,397 width=15) (actual time=7,620.037..9,182.410 rows=1,815,979 loops=1)

8. 2,569.838 8,436.884 ↓ 1.0 1,815,979 1

Sort (cost=1,605,049.59..1,609,543.09 rows=1,797,397 width=15) (actual time=7,620.032..8,436.884 rows=1,815,979 loops=1)

  • Sort Key: acts.case_file_id
  • Sort Method: external merge Disk: 46104kB
9. 5,867.046 5,867.046 ↓ 1.0 1,816,689 1

Seq Scan on activities acts (cost=0.00..1,387,603.21 rows=1,797,397 width=15) (actual time=0.024..5,867.046 rows=1,816,689 loops=1)

  • Filter: ((type)::text = 'SendEmailActivity'::text)
  • Rows Removed by Filter: 9967922
Planning time : 0.317 ms