explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2Jif

Settings
# exclusive inclusive rows x rows loops node
1. 122.504 1,807.701 ↑ 1.0 1 1

Aggregate (cost=39,403.22..39,403.23 rows=1 width=8) (actual time=1,807.700..1,807.701 rows=1 loops=1)

2. 155.739 1,685.197 ↓ 171.0 162,810 1

Nested Loop (cost=30,225.99..39,396.08 rows=952 width=16) (actual time=233.303..1,685.197 rows=162,810 loops=1)

3. 66.832 552.598 ↓ 176.8 162,810 1

Subquery Scan on a (cost=30,225.56..36,211.02 rows=921 width=24) (actual time=233.278..552.598 rows=162,810 loops=1)

  • Filter: (a.row_count = 1)
  • Rows Removed by Filter: 22605
4. 200.952 485.766 ↓ 1.0 185,415 1

WindowAgg (cost=30,225.56..33,908.92 rows=184,168 width=32) (actual time=233.275..485.766 rows=185,415 loops=1)

5. 167.786 284.814 ↓ 1.0 185,415 1

Sort (cost=30,225.56..30,685.98 rows=184,168 width=24) (actual time=233.253..284.814 rows=185,415 loops=1)

  • Sort Key: event_identify_a34683f0_c40e_4a8f_bdfd_a4d2cbf54ef1.person_id, event_identify_a34683f0_c40e_4a8f_bdfd_a4d2cbf54ef1.timestamp_
  • Sort Method: quicksort Memory: 20630kB
6. 55.701 117.028 ↓ 1.0 185,415 1

Append (cost=0.00..14,119.46 rows=184,168 width=24) (actual time=0.011..117.028 rows=185,415 loops=1)

7. 0.003 0.003 ↓ 0.0 0 1

Seq Scan on event_identify_a34683f0_c40e_4a8f_bdfd_a4d2cbf54ef1 (cost=0.00..0.00 rows=1 width=24) (actual time=0.003..0.003 rows=0 loops=1)

8. 14.791 14.791 ↑ 1.0 44,605 1

Seq Scan on event_identify_a34683f0_c40e_4a8f_bdfd_a4d2cbf54ef1_2018_2 (cost=0.00..2,972.93 rows=44,693 width=24) (actual time=0.007..14.791 rows=44,605 loops=1)

9. 4.123 4.123 ↑ 1.0 12,964 1

Seq Scan on event_identify_a34683f0_c40e_4a8f_bdfd_a4d2cbf54ef1_2018_3 (cost=0.00..863.99 rows=12,999 width=24) (actual time=0.006..4.123 rows=12,964 loops=1)

10. 1.126 1.126 ↑ 1.0 3,412 1

Seq Scan on event_identify_a34683f0_c40e_4a8f_bdfd_a4d2cbf54ef1_2018_4 (cost=0.00..277.12 rows=3,412 width=24) (actual time=0.004..1.126 rows=3,412 loops=1)

11. 5.140 5.140 ↑ 1.0 15,453 1

Seq Scan on event_identify_a34683f0_c40e_4a8f_bdfd_a4d2cbf54ef1_2018_5 (cost=0.00..1,250.53 rows=15,453 width=24) (actual time=0.006..5.140 rows=15,453 loops=1)

12. 5.549 5.549 ↑ 1.0 16,771 1

Seq Scan on event_identify_a34683f0_c40e_4a8f_bdfd_a4d2cbf54ef1_2018_6 (cost=0.00..1,355.71 rows=16,771 width=24) (actual time=0.004..5.549 rows=16,771 loops=1)

13. 5.871 5.871 ↑ 1.0 17,869 1

Seq Scan on event_identify_a34683f0_c40e_4a8f_bdfd_a4d2cbf54ef1_2018_7 (cost=0.00..1,443.69 rows=17,869 width=24) (actual time=0.004..5.871 rows=17,869 loops=1)

14. 5.679 5.679 ↑ 1.0 17,265 1

Seq Scan on event_identify_a34683f0_c40e_4a8f_bdfd_a4d2cbf54ef1_2018_8 (cost=0.00..1,397.65 rows=17,265 width=24) (actual time=0.004..5.679 rows=17,265 loops=1)

15. 5.093 5.093 ↑ 1.0 15,614 1

Seq Scan on event_identify_a34683f0_c40e_4a8f_bdfd_a4d2cbf54ef1_2018_9 (cost=0.00..1,259.14 rows=15,614 width=24) (actual time=0.006..5.093 rows=15,614 loops=1)

16. 5.571 5.571 ↑ 1.0 16,960 1

Seq Scan on event_identify_a34683f0_c40e_4a8f_bdfd_a4d2cbf54ef1_2018_10 (cost=0.00..1,351.60 rows=16,960 width=24) (actual time=0.005..5.571 rows=16,960 loops=1)

17. 7.549 7.549 ↓ 1.0 23,034 1

Seq Scan on event_identify_a34683f0_c40e_4a8f_bdfd_a4d2cbf54ef1_2018_11 (cost=0.00..1,857.27 rows=23,027 width=24) (actual time=0.004..7.549 rows=23,034 loops=1)

18. 0.832 0.832 ↓ 14.1 1,468 1

Index Only Scan using eid_a34683f0_c40e_4a8f_bdfd_a4d2cbf54ef1_2018_12_pid_ses_ts on event_identify_a34683f0_c40e_4a8f_bdfd_a4d2cbf54ef1_2018_12 (cost=0.27..89.83 rows=104 width=24) (actual time=0.020..0.832 rows=1,468 loops=1)

  • Heap Fetches: 1468
19. 976.860 976.860 ↑ 1.0 1 162,810

Index Scan using session_a34683f0_c40e_4a8f_bdfd_a4d2cbf54ef1__pid_ts on session_a34683f0_c40e_4a8f_bdfd_a4d2cbf54ef1 s (cost=0.43..3.45 rows=1 width=24) (actual time=0.003..0.006 rows=1 loops=162,810)

  • Index Cond: (person_id = a.person_id)
  • Filter: ((visit_type)::text = 'First Visit'::text)
  • Rows Removed by Filter: 2