explain.depesz.com

PostgreSQL's explain analyze made readable

Result: FtLlV

Settings
# exclusive inclusive rows x rows loops node
1. 9.126 22,743.836 ↓ 3,150.0 3,150 1

Sort (cost=7,159.00..7,159.00 rows=1 width=233) (actual time=22,742.978..22,743.836 rows=3,150 loops=1)

  • Sort Key: t.ticket_id DESC
  • Sort Method: quicksort Memory: 982kB
2. 4.485 22,734.710 ↓ 3,150.0 3,150 1

Nested Loop Left Join (cost=1.12..7,158.99 rows=1 width=233) (actual time=10.781..22,734.710 rows=3,150 loops=1)

3. 3.041 69.125 ↓ 3,150.0 3,150 1

Nested Loop Left Join (cost=1.12..826.79 rows=1 width=214) (actual time=0.041..69.125 rows=3,150 loops=1)

4. 4.973 50.334 ↓ 3,150.0 3,150 1

Nested Loop Left Join (cost=0.71..824.16 rows=1 width=198) (actual time=0.031..50.334 rows=3,150 loops=1)

5. 8.415 29.611 ↓ 3,150.0 3,150 1

Nested Loop Left Join (cost=0.28..821.52 rows=1 width=134) (actual time=0.021..29.611 rows=3,150 loops=1)

6. 8.596 8.596 ↓ 3,150.0 3,150 1

Seq Scan on ticket_analytics t (cost=0.00..819.01 rows=1 width=131) (actual time=0.012..8.596 rows=3,150 loops=1)

  • Filter: (active AND (created_at >= '2019-01-01 05:00:00'::timestamp without time zone) AND (created_at <= '2019-04-11 04:59:59'::timestamp without time zone) AND (company_uuid = 'd8916184-7bb1-4106-bae3-d1d8f69b3c19'::uuid) AND ((expired)::integer = 0) AND (((open)::integer = 1) OR ((in_progress)::integer = 1) OR ((to_be_approved)::integer = 1) OR (((open)::integer = 1) AND ((late)::integer = 1)) OR (((in_progress)::integer = 1) AND ((late)::integer = 1)) OR (((to_be_approved)::integer = 1) AND ((late)::integer = 1))))
  • Rows Removed by Filter: 4648
7. 12.600 12.600 ↑ 1.0 1 3,150

Index Scan using "index_ticket_manager.ticket_definitions_on_uuid" on ticket_definitions (cost=0.28..2.50 rows=1 width=35) (actual time=0.004..0.004 rows=1 loops=3,150)

  • Index Cond: (uuid = t.definition_uuid)
8. 15.750 15.750 ↑ 1.0 1 3,150

Index Scan using index_stores_on_uuid on stores (cost=0.42..2.64 rows=1 width=80) (actual time=0.005..0.005 rows=1 loops=3,150)

  • Index Cond: (uuid = t.store_uuid)
9. 15.750 15.750 ↑ 1.0 1 3,150

Index Scan using "index_ticket_manager.tickets_on_uuid" on tickets (cost=0.41..2.63 rows=1 width=32) (actual time=0.005..0.005 rows=1 loops=3,150)

  • Index Cond: (uuid = t.uuid)
10. 6.300 22,661.100 ↓ 0.0 0 3,150

GroupAggregate (cost=0.00..6,332.18 rows=1 width=48) (actual time=7.194..7.194 rows=0 loops=3,150)

  • Group Key: tickets_1.parent_uuid
11. 22,654.800 22,654.800 ↓ 0.0 0 3,150

Seq Scan on tickets tickets_1 (cost=0.00..6,332.15 rows=1 width=28) (actual time=7.084..7.192 rows=0 loops=3,150)

  • Filter: ((parent_uuid IS NOT NULL) AND (reopen_user_uuid IS NULL) AND (uuid <> tickets.current_child_uuid) AND (parent_uuid = t.uuid))
  • Rows Removed by Filter: 30176