explain.depesz.com

PostgreSQL's explain analyze made readable

Result: anAW

Settings
# exclusive inclusive rows x rows loops node
1. 0.002 53.577 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.55..54,458.85 rows=1 width=3,895) (actual time=53.576..53.577 rows=0 loops=1)

  • Join Filter: (((items.author_type)::text = 'User'::text) AND (users.id = items.author_id))
  • Planning time: 15.245 ms
  • Execution time: 53.854 ms
2. 0.001 53.575 ↓ 0.0 0 1

Nested Loop Left Join (cost=1.55..54,330.38 rows=1 width=3,408) (actual time=53.575..53.575 rows=0 loops=1)

  • Join Filter: (sources.id = items.source_id)
3. 0.000 53.574 ↓ 0.0 0 1

Nested Loop (cost=1.55..54,275.00 rows=1 width=3,152) (actual time=53.574..53.574 rows=0 loops=1)

4. 1.790 53.574 ↓ 0.0 0 1

Nested Loop (cost=0.99..35,336.25 rows=213 width=3,012) (actual time=53.574..53.574 rows=0 loops=1)

5. 33.528 33.528 ↑ 1.6 2,282 1

Index Scan using index_items_on_type_and_author_type_and_created_at on items (cost=0.56..8,507.44 rows=3,569 width=1,041) (actual time=0.084..33.528 rows=2,282 loops=1)

  • Index Cond: (((type)::text = 'Message'::text) AND ((author_type)::text = 'User'::text) AND (created_at >= '2018-04-25 00:00:00'::timestamp without time zone) AND (created_at <= '2018-04-25 23:59:59.999999'::timestamp without time zone))
6. 18.256 18.256 ↓ 0.0 0 2,282

Index Scan using tickets_pkey on tickets (cost=0.43..7.51 rows=1 width=1,971) (actual time=0.008..0.008 rows=0 loops=2,282)

  • Index Cond: (id = items.ticket_id)
  • Filter: (group_id IS NULL)
  • Rows Removed by Filter: 1
7. 0.000 0.000 ↓ 0.0 0

Index Scan using index_events_on_ticket_id on events (cost=0.56..88.90 rows=1 width=140) (never executed)

  • Index Cond: (ticket_id = tickets.id)
  • Filter: ((created_at >= '2018-04-25 00:00:00'::timestamp without time zone) AND (created_at <= '2018-04-25 23:59:59.999999'::timestamp without time zone) AND ((type)::text = 'TicketViewed'::text) AND (((data)::json ->> 'opened_by'::text) = ((data)::json ->> 'managed_by'::text)))
8. 0.000 0.000 ↓ 0.0 0

Seq Scan on sources (cost=0.00..54.61 rows=61 width=256) (never executed)

9. 0.000 0.000 ↓ 0.0 0

Seq Scan on users (cost=0.00..106.59 rows=1,459 width=487) (never executed)