explain.depesz.com

PostgreSQL's explain analyze made readable

Result: YM3I

Settings
# exclusive inclusive rows x rows loops node
1. 0.105 56,555.375 ↓ 12.0 12 1

Nested Loop Left Join (cost=173.25..2,400.01 rows=1 width=324) (actual time=61.411..56,555.375 rows=12 loops=1)

  • Filter: (dis.read_at IS NULL)
2. 0.123 56,539.910 ↓ 12.0 12 1

Merge Join (cost=172.70..2,391.48 rows=1 width=313) (actual time=56.424..56,539.910 rows=12 loops=1)

  • Merge Cond: (a.entity_id = s.id)
3. 56,535.926 56,535.926 ↑ 12.8 68 1

Index Scan using notifications_type_entity on notifications a (cost=0.43..1,923,062.32 rows=867 width=260) (actual time=52.569..56,535.926 rows=68 loops=1)

  • Filter: ((resolved IS FALSE) AND (uuid = ANY ('{06-0000-0000-0000000000000000,08-0000-0000-0000000000000000}'::text[])) AND (occurred_at > (now() - '30 days'::interval)))
  • Rows Removed by Filter: 7637698
4. 0.193 3.861 ↑ 1.0 200 1

Sort (cost=171.96..172.47 rows=201 width=57) (actual time=3.804..3.861 rows=200 loops=1)

  • Sort Key: s.id
  • Sort Method: quicksort Memory: 52kB
5. 3.668 3.668 ↑ 1.0 201 1

Seq Scan on surveys s (cost=0.00..164.28 rows=201 width=57) (actual time=0.018..3.668 rows=201 loops=1)

  • Filter: (organisation_id = 273)
  • Rows Removed by Filter: 1344
6. 15.360 15.360 ↓ 0.0 0 12

Index Scan using notifications_read_by_user on notifications_users dis (cost=0.56..8.52 rows=1 width=16) (actual time=1.280..1.280 rows=0 loops=12)

  • Index Cond: ((a.id = notification_id) AND (user_id = 915) AND (org_id = 166))
Planning time : 28.168 ms
Execution time : 56,555.643 ms