explain.depesz.com

PostgreSQL's explain analyze made readable

Result: xSt

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1.55..318,911.16 rows=1 width=3,895) (actual rows= loops=)

  • Join Filter: (((items.author_type)::text = 'User'::text) AND (users.id = items.author_id))
2. 0.000 0.000 ↓ 0.0

Nested Loop Left Join (cost=1.55..318,782.68 rows=1 width=3,408) (actual rows= loops=)

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

Nested Loop (cost=1.55..318,727.31 rows=1 width=3,152) (actual rows= loops=)

4. 0.000 0.000 ↓ 0.0

Nested Loop (cost=0.99..299,531.54 rows=216 width=3,012) (actual rows= loops=)

5. 0.000 0.000 ↓ 0.0

Index Scan using index_items_on_type_and_ticket_id_and_created_at on items (cost=0.56..272,402.13 rows=3,614 width=1,041) (actual rows= loops=)

  • Index Cond: (((type)::text = 'Message'::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))
  • Filter: ((author_type)::text = 'User'::text)
6. 0.000 0.000 ↓ 0.0

Index Scan using tickets_pkey on tickets (cost=0.43..7.50 rows=1 width=1,971) (actual rows= loops=)

  • Index Cond: (id = items.ticket_id)
  • Filter: (group_id IS NULL)
7. 0.000 0.000 ↓ 0.0

Index Scan using index_events_on_ticket_id on events (cost=0.56..88.86 rows=1 width=140) (actual rows= loops=)

  • 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

Seq Scan on sources (cost=0.00..54.61 rows=61 width=256) (actual rows= loops=)

9. 0.000 0.000 ↓ 0.0

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