explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FjET

Settings
# exclusive inclusive rows x rows loops node
1. 6.504 4,107.912 ↓ 8.0 8 1

GroupAggregate (cost=56,510.00..56,510.02 rows=1 width=42) (actual time=4,100.683..4,107.912 rows=8 loops=1)

  • Group Key: s.cf_source_category
2. 12.708 4,101.408 ↓ 49,900.0 49,900 1

Sort (cost=56,510.00..56,510.00 rows=1 width=13) (actual time=4,099.554..4,101.408 rows=49,900 loops=1)

  • Sort Key: s.cf_source_category
  • Sort Method: quicksort Memory: 3862kB
3. 372.118 4,088.700 ↓ 49,900.0 49,900 1

Gather (cost=47,383.76..56,509.99 rows=1 width=13) (actual time=307.974..4,088.700 rows=49,900 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
4. 2,435.298 3,716.582 ↓ 24,950.0 24,950 2

Merge Left Join (cost=46,383.76..55,509.89 rows=1 width=13) (actual time=306.401..3,716.582 rows=24,950 loops=2)

  • Merge Cond: (e.person_id = s.person_id)
  • Join Filter: (s.first_seen <= e.timestamp_)
  • Rows Removed by Join Filter: 7132540
  • Filter: (s2.id IS NULL)
  • Rows Removed by Filter: 17273153
5. 70.376 106.512 ↑ 1.2 47,242 2

Sort (cost=10,716.17..10,855.12 rows=55,577 width=27) (actual time=101.965..106.512 rows=47,242 loops=2)

  • Sort Key: e.person_id
  • Sort Method: external merge Disk: 2032kB
6. 2.554 36.136 ↑ 1.2 47,242 2

Append (cost=0.00..6,336.09 rows=55,577 width=27) (actual time=0.029..36.136 rows=47,242 loops=2)

7. 0.001 0.001 ↓ 0.0 0 2

Parallel Seq Scan on event_ecommerce_4070ba14_f081_41cb_9ef7_9dd385934da7 e (cost=0.00..0.00 rows=1 width=40) (actual time=0.001..0.001 rows=0 loops=2)

  • Filter: ((timestamp_ >= '2018-01-01 06:00:00'::timestamp without time zone) AND (timestamp_ <= '2018-04-01 05:59:59.999'::timestamp without time zone))
8. 22.744 22.744 ↑ 1.2 23,874 2

Parallel Seq Scan on event_ecommerce_4070ba14_f081_41cb_9ef7_9dd385934da7_2018_1 e_1 (cost=0.00..3,250.74 rows=28,091 width=27) (actual time=0.027..22.744 rows=23,874 loops=2)

  • Filter: ((timestamp_ >= '2018-01-01 06:00:00'::timestamp without time zone) AND (timestamp_ <= '2018-04-01 05:59:59.999'::timestamp without time zone))
  • Rows Removed by Filter: 80
9. 4.848 4.848 ↑ 1.2 11,638 2

Parallel Seq Scan on event_ecommerce_4070ba14_f081_41cb_9ef7_9dd385934da7_2018_2 e_2 (cost=0.00..1,543.38 rows=13,689 width=27) (actual time=0.006..4.848 rows=11,638 loops=2)

  • Filter: ((timestamp_ >= '2018-01-01 06:00:00'::timestamp without time zone) AND (timestamp_ <= '2018-04-01 05:59:59.999'::timestamp without time zone))
10. 5.989 5.989 ↑ 1.2 11,729 2

Parallel Seq Scan on event_ecommerce_4070ba14_f081_41cb_9ef7_9dd385934da7_2018_3 e_3 (cost=0.00..1,541.98 rows=13,796 width=27) (actual time=0.003..5.989 rows=11,729 loops=2)

  • Filter: ((timestamp_ >= '2018-01-01 06:00:00'::timestamp without time zone) AND (timestamp_ <= '2018-04-01 05:59:59.999'::timestamp without time zone))
11. 896.026 1,174.772 ↓ 257.1 24,448,001 2

Materialize (cost=35,667.59..41,125.47 rows=95,089 width=50) (actual time=204.416..1,174.772 rows=24,448,001 loops=2)

12. 45.765 278.746 ↓ 1.8 169,141 2

Merge Left Join (cost=35,667.59..40,887.75 rows=95,089 width=50) (actual time=204.412..278.746 rows=169,141 loops=2)

  • Merge Cond: (s.person_id = s2.person_id)
  • Join Filter: (s2.first_seen > s.first_seen)
  • Rows Removed by Join Filter: 185702
13. 56.076 125.363 ↑ 1.0 45,600 2

Sort (cost=17,833.79..17,947.80 rows=45,601 width=34) (actual time=121.373..125.363 rows=45,600 loops=2)

  • Sort Key: s.person_id
  • Sort Method: external merge Disk: 2176kB
14. 69.287 69.287 ↑ 1.0 45,601 2

Seq Scan on session_4070ba14_f081_41cb_9ef7_9dd385934da7 s (cost=0.00..14,305.01 rows=45,601 width=34) (actual time=0.050..69.287 rows=45,601 loops=2)

15. 55.517 107.618 ↓ 7.1 325,804 2

Sort (cost=17,833.79..17,947.80 rows=45,601 width=40) (actual time=83.033..107.618 rows=325,804 loops=2)

  • Sort Key: s2.person_id
  • Sort Method: external sort Disk: 2416kB
16. 52.101 52.101 ↑ 1.0 45,601 2

Seq Scan on session_4070ba14_f081_41cb_9ef7_9dd385934da7 s2 (cost=0.00..14,305.01 rows=45,601 width=40) (actual time=0.019..52.101 rows=45,601 loops=2)