explain.depesz.com

PostgreSQL's explain analyze made readable

Result: kDcR

Settings
# exclusive inclusive rows x rows loops node
1. 0.031 18.122 ↑ 1.0 100 1

Limit (cost=12,509.62..12,509.87 rows=100 width=266) (actual time=18.061..18.122 rows=100 loops=1)

2. 1.597 18.091 ↑ 6.5 100 1

Sort (cost=12,509.62..12,511.24 rows=647 width=266) (actual time=18.059..18.091 rows=100 loops=1)

  • Sort Key: notifications.time_to_display DESC
  • Sort Method: top-N heapsort Memory: 69kB
3. 3.549 16.494 ↓ 2.9 1,857 1

Nested Loop (cost=41.35..12,484.89 rows=647 width=266) (actual time=0.393..16.494 rows=1,857 loops=1)

4. 2.310 2.581 ↓ 2.4 2,591 1

Bitmap Heap Scan on user_notifications (cost=40.92..3,955.47 rows=1,096 width=5) (actual time=0.379..2.581 rows=2,591 loops=1)

  • Recheck Cond: (user_id = 982)
  • Heap Blocks: exact=962
5. 0.271 0.271 ↓ 2.4 2,591 1

Bitmap Index Scan on index_user_notifications_on_user_id_and_notification_id (cost=0.00..40.65 rows=1,096 width=0) (actual time=0.271..0.271 rows=2,591 loops=1)

  • Index Cond: (user_id = 982)
6. 10.364 10.364 ↑ 1.0 1 2,591

Index Scan using notifications_pkey on notifications (cost=0.43..7.77 rows=1 width=265) (actual time=0.004..0.004 rows=1 loops=2,591)

  • Index Cond: (id = user_notifications.notification_id)
  • Filter: ((text IS NOT NULL) AND (time_to_display IS NOT NULL) AND vetted AND (created_at < '2020-03-20 21:17:56.522209'::timestamp without time zone))
  • Rows Removed by Filter: 0
Planning time : 0.346 ms