explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Xsei

Settings
# exclusive inclusive rows x rows loops node
1. 0.075 883.395 ↑ 1.0 1 1

Aggregate (cost=22,620.57..22,620.57 rows=1 width=8) (actual time=883.395..883.395 rows=1 loops=1)

  • Buffers: shared hit=13,199
2. 49.190 883.320 ↑ 95.5 48 1

Merge Join (cost=19,594.70..22,618.28 rows=4,583 width=19) (actual time=788.507..883.320 rows=48 loops=1)

  • Merge Cond: (convo."lastReceivedMessageId" = lmr.id)
  • Join Filter: ((lms.id IS NULL) OR (lmr."sentAt" > lms."sentAt"))
  • Rows Removed by Join Filter: 26
  • Buffers: shared hit=13,199
3. 0.000 11.604 ↑ 183.3 75 1

Gather Merge (cost=1,000.25..35,243.54 rows=13,749 width=64) (actual time=6.337..11.604 rows=75 loops=1)

  • Workers Planned: 1
  • Workers Launched: 1
  • Buffers: shared hit=16,676
4. 0.234 12.919 ↑ 18.5 438 2 / 2

Nested Loop Left Join (cost=0.25..32,779.27 rows=8,088 width=64) (actual time=0.750..12.919 rows=438 loops=2)

  • Buffers: shared hit=16,676
5. 0.099 10.933 ↑ 18.5 438 2 / 2

Nested Loop (cost=0.17..19,190.64 rows=8,088 width=54) (actual time=0.726..10.933 rows=438 loops=2)

  • Buffers: shared hit=13,199
6. 7.366 7.366 ↑ 14.0 578 2 / 2

Parallel Index Scan using "IDX_10b5e0060741e7df5fd6893a39" on conversation convo (cost=0.08..5,602.01 rows=8,088 width=71) (actual time=0.682..7.366 rows=578 loops=2)

  • Filter: ((NOT "isArchived") AND ("shopId" = 'shopify-23182543'::text))
  • Rows Removed by Filter: 4,238
  • Buffers: shared hit=9,693
7. 3.468 3.468 ↑ 1.0 1 1,156 / 2

Index Only Scan using "PK_ba01f0a3e0123651915008bc578" on message lm (cost=0.08..1.68 rows=1 width=19) (actual time=0.006..0.006 rows=1 loops=1,156)

  • Index Cond: (id = convo."lastMessageId")
  • Heap Fetches: 876
  • Buffers: shared hit=3,506
8. 1.752 1.752 ↑ 1.0 1 876 / 2

Index Scan using "PK_ba01f0a3e0123651915008bc578" on message lms (cost=0.08..1.68 rows=1 width=27) (actual time=0.004..0.004 rows=1 loops=876)

  • Index Cond: (id = convo."lastSentMessageId")
  • Buffers: shared hit=3,477
9. 717.104 822.526 ↑ 1.0 257,275 1

Sort (cost=18,594.38..18,726.69 rows=264,610 width=27) (actual time=782.006..822.526 rows=257,275 loops=1)

  • Sort Key: lmr.id
  • Sort Method: quicksort Memory: 32,509kB
  • Buffers: shared hit=13,034
10. 105.422 105.422 ↑ 1.0 264,075 1

Seq Scan on message lmr (cost=0.00..13,827.83 rows=264,610 width=27) (actual time=0.014..105.422 rows=264,075 loops=1)

  • Filter: (id IS NOT NULL)
  • Buffers: shared hit=13,034
Planning time : 2.493 ms
Execution time : 889.736 ms