explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 7NvE

Settings
# exclusive inclusive rows x rows loops node
1. 0.034 16,257.698 ↑ 9.4 7 1

Sort (cost=599,615.38..599,615.54 rows=66 width=101) (actual time=16,257.698..16,257.698 rows=7 loops=1)

  • Sort Key: ((latest_items.fields ->> 'timestamp'::text))
  • Sort Method: quicksort Memory: 25kB
2. 0.011 16,257.664 ↑ 9.4 7 1

Subquery Scan on latest_items (cost=599,316.69..599,613.38 rows=66 width=101) (actual time=16,257.640..16,257.664 rows=7 loops=1)

  • Filter: (((latest_items.fields -> 'initiator'::text) ->> 'type'::text) = 'CUSTOMER'::text)
  • Rows Removed by Filter: 1
3. 0.017 16,257.653 ↑ 1,647.4 8 1

Unique (cost=599,316.69..599,382.59 rows=13,179 width=597) (actual time=16,257.635..16,257.653 rows=8 loops=1)

4. 0.000 16,257.636 ↑ 488.1 27 1

Sort (cost=599,316.69..599,349.64 rows=13,179 width=597) (actual time=16,257.633..16,257.636 rows=27 loops=1)

  • Sort Key: ci.conversation_id, ((ci.fields ->> 'timestamp'::text)) DESC
  • Sort Method: quicksort Memory: 57kB
5. 41.393 16,261.302 ↑ 488.1 27 1

Gather (cost=1,000.97..594,900.86 rows=13,179 width=597) (actual time=16,143.914..16,261.302 rows=27 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
6. 16,028.223 16,219.909 ↑ 610.1 9 3

Nested Loop (cost=0.97..592,563.74 rows=5,491 width=597) (actual time=10,802.047..16,219.909 rows=9 loops=3)

7. 190.566 190.566 ↑ 1.1 14,293 3

Parallel Index Scan using conversations_next_idx on conversations c (cost=0.41..13,918.15 rows=16,328 width=23) (actual time=4.525..190.566 rows=14,293 loops=3)

8. 1.120 1.120 ↓ 0.0 0 42,879

Index Scan using conversation_items_conversation_idx on conversation_items ci (cost=0.56..35.43 rows=1 width=561) (actual time=1.120..1.120 rows=0 loops=42,879)

  • Index Cond: ((conversation_id = c.id) AND ((fields ->> 'timestamp'::text) > '2019-02-29T00:00:00.000Z'::text))
  • Filter: (((fields -> 'content'::text) ->> 'type'::text) = 'SMS'::text)
  • Rows Removed by Filter: 3