explain.depesz.com

PostgreSQL's explain analyze made readable

Result: rRz : Optimization for: plan #85qE

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 2.596 132.241 ↓ 2.8 4,218 1

Sort (cost=181,868.15..181,871.94 rows=1,515 width=85) (actual time=131.950..132.241 rows=4,218 loops=1)

  • Sort Key: e.id
  • Sort Method: quicksort Memory: 786kB
2. 5.791 129.645 ↓ 2.8 4,218 1

Nested Loop Left Join (cost=0.00..181,788.12 rows=1,515 width=85) (actual time=0.133..129.645 rows=4,218 loops=1)

3. 0.385 31.058 ↓ 2.8 4,218 1

Append (cost=0.00..5,417.86 rows=1,515 width=76) (actual time=0.078..31.058 rows=4,218 loops=1)

4. 0.002 0.002 ↓ 0.0 0 1

Seq Scan on event e (cost=0.00..0.00 rows=1 width=76) (actual time=0.002..0.002 rows=0 loops=1)

  • Filter: ((NOT acknowledged) AND (event_time_utc > '2019-01-31 02:26:49.814238'::timestamp without time zone) AND (create_time_utc > '2019-03-11 02:26:49.814238'::timestamp without time zone) AND (confirmation_state = 'pending'::enum_confirmation_state))
5. 0.268 0.268 ↑ 1.6 74 1

Index Scan using i_event_2019m02_create_time on event_2019m02 e_1 (cost=0.42..1,128.20 rows=121 width=76) (actual time=0.076..0.268 rows=74 loops=1)

  • Index Cond: (create_time_utc > '2019-03-11 02:26:49.814238'::timestamp without time zone)
  • Filter: ((NOT acknowledged) AND (event_time_utc > '2019-01-31 02:26:49.814238'::timestamp without time zone) AND (confirmation_state = 'pending'::enum_confirmation_state))
  • Rows Removed by Filter: 32
6. 0.025 0.025 ↓ 0.0 0 1

Index Scan using i_event_2019m01_create_time on event_2019m01 e_2 (cost=0.42..102.53 rows=1 width=76) (actual time=0.025..0.025 rows=0 loops=1)

  • Index Cond: (create_time_utc > '2019-03-11 02:26:49.814238'::timestamp without time zone)
  • Filter: ((NOT acknowledged) AND (event_time_utc > '2019-01-31 02:26:49.814238'::timestamp without time zone) AND (confirmation_state = 'pending'::enum_confirmation_state))
  • Rows Removed by Filter: 7
7. 30.378 30.378 ↓ 3.0 4,144 1

Index Scan using i_event_2019m03_unread on event_2019m03 e_3 (cost=0.29..4,187.12 rows=1,392 width=76) (actual time=21.836..30.378 rows=4,144 loops=1)

  • Filter: ((event_time_utc > '2019-01-31 02:26:49.814238'::timestamp without time zone) AND (create_time_utc > '2019-03-11 02:26:49.814238'::timestamp without time zone))
  • Rows Removed by Filter: 12760
8. 25.308 92.796 ↑ 15.0 1 4,218

Append (cost=0.00..116.27 rows=15 width=16) (actual time=0.022..0.022 rows=1 loops=4,218)

9. 0.000 0.000 ↓ 0.0 0 4,218

Seq Scan on shift_record sr (cost=0.00..0.00 rows=1 width=16) (actual time=0.000..0.000 rows=0 loops=4,218)

  • Filter: (event_id = e.id)
10. 4.218 4.218 ↓ 0.0 0 4,218

Index Scan using pk_shift_record_2019m02 on shift_record_2019m02 sr_1 (cost=0.43..8.35 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=4,218)

  • Index Cond: (event_id = e.id)
11. 4.218 4.218 ↓ 0.0 0 4,218

Index Scan using pk_shift_record_2018m12 on shift_record_2018m12 sr_2 (cost=0.43..8.35 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=4,218)

  • Index Cond: (event_id = e.id)
12. 4.218 4.218 ↓ 0.0 0 4,218

Index Scan using pk_shift_record_2018m02 on shift_record_2018m02 sr_3 (cost=0.43..8.25 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=4,218)

  • Index Cond: (event_id = e.id)
13. 4.218 4.218 ↓ 0.0 0 4,218

Index Scan using pk_shift_record_2019m01 on shift_record_2019m01 sr_4 (cost=0.43..8.35 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=4,218)

  • Index Cond: (event_id = e.id)
14. 4.218 4.218 ↓ 0.0 0 4,218

Index Scan using pk_shift_record_2018m03 on shift_record_2018m03 sr_5 (cost=0.43..8.27 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=4,218)

  • Index Cond: (event_id = e.id)
15. 4.218 4.218 ↓ 0.0 0 4,218

Index Scan using pk_shift_record_2018m08 on shift_record_2018m08 sr_6 (cost=0.43..8.33 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=4,218)

  • Index Cond: (event_id = e.id)
16. 4.218 4.218 ↓ 0.0 0 4,218

Index Scan using pk_shift_record_2018m04 on shift_record_2018m04 sr_7 (cost=0.43..8.27 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=4,218)

  • Index Cond: (event_id = e.id)
17. 4.218 4.218 ↓ 0.0 0 4,218

Index Scan using pk_shift_record_2018m11 on shift_record_2018m11 sr_8 (cost=0.43..8.35 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=4,218)

  • Index Cond: (event_id = e.id)
18. 4.218 4.218 ↓ 0.0 0 4,218

Index Scan using pk_shift_record_2018m05 on shift_record_2018m05 sr_9 (cost=0.43..8.28 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=4,218)

  • Index Cond: (event_id = e.id)
19. 4.218 4.218 ↓ 0.0 0 4,218

Index Scan using pk_shift_record_2018m10 on shift_record_2018m10 sr_10 (cost=0.43..8.35 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=4,218)

  • Index Cond: (event_id = e.id)
20. 4.218 4.218 ↓ 0.0 0 4,218

Index Scan using pk_shift_record_2018m06 on shift_record_2018m06 sr_11 (cost=0.43..8.30 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=4,218)

  • Index Cond: (event_id = e.id)
21. 4.218 4.218 ↓ 0.0 0 4,218

Index Scan using pk_shift_record_2018m07 on shift_record_2018m07 sr_12 (cost=0.43..8.32 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=4,218)

  • Index Cond: (event_id = e.id)
22. 4.218 4.218 ↓ 0.0 0 4,218

Index Scan using pk_shift_record_2018m09 on shift_record_2018m09 sr_13 (cost=0.43..8.33 rows=1 width=16) (actual time=0.001..0.001 rows=0 loops=4,218)

  • Index Cond: (event_id = e.id)
23. 12.654 12.654 ↑ 1.0 1 4,218

Index Scan using pk_shift_record_2019m03 on shift_record_2019m03 sr_14 (cost=0.43..8.18 rows=1 width=16) (actual time=0.003..0.003 rows=1 loops=4,218)

  • Index Cond: (event_id = e.id)