explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mCd

Settings
# exclusive inclusive rows x rows loops node
1. 0.131 1.632 ↓ 79.0 79 1

Sort (cost=5.84..5.84 rows=1 width=663) (actual time=1.611..1.632 rows=79 loops=1)

  • Sort Key: message.date_created, message.thread_id
  • Sort Method: quicksort Memory: 85kB
2. 0.418 1.501 ↓ 79.0 79 1

GroupAggregate (cost=5.80..5.83 rows=1 width=663) (actual time=1.098..1.501 rows=79 loops=1)

  • Group Key: message.id, message.sender_id, message.sender_type, sender_organization.id, sender_organization.type
3. 0.138 1.083 ↓ 91.0 91 1

Sort (cost=5.80..5.80 rows=1 width=663) (actual time=1.057..1.083 rows=91 loops=1)

  • Sort Key: message.id, message.sender_id, message.sender_type, sender_organization.id, sender_organization.type
  • Sort Method: quicksort Memory: 82kB
4. 0.092 0.945 ↓ 91.0 91 1

Nested Loop (cost=2.03..5.79 rows=1 width=663) (actual time=0.086..0.945 rows=91 loops=1)

5. 0.062 0.398 ↓ 45.5 91 1

Nested Loop (cost=1.89..5.19 rows=2 width=560) (actual time=0.076..0.398 rows=91 loops=1)

6. 0.085 0.154 ↓ 45.5 91 1

Hash Join (cost=1.75..3.77 rows=2 width=168) (actual time=0.068..0.154 rows=91 loops=1)

  • Hash Cond: ((message_recipient.organization_type = recipient.type) AND (message_recipient.organization_id = recipient.id))
7. 0.021 0.021 ↓ 1.6 91 1

Seq Scan on message_recipient (cost=0.00..1.57 rows=57 width=45) (actual time=0.003..0.021 rows=91 loops=1)

8. 0.027 0.048 ↓ 1.3 40 1

Hash (cost=1.30..1.30 rows=30 width=216) (actual time=0.048..0.048 rows=40 loops=1)

  • Buckets: 1024 Batches: 1 Memory Usage: 14kB
9. 0.021 0.021 ↓ 1.3 40 1

Seq Scan on organization recipient (cost=0.00..1.30 rows=30 width=216) (actual time=0.006..0.021 rows=40 loops=1)

10. 0.182 0.182 ↑ 1.0 1 91

Index Scan using pk_message_id on message (cost=0.14..0.70 rows=1 width=408) (actual time=0.001..0.002 rows=1 loops=91)

  • Index Cond: (id = message_recipient.message_id)
  • Filter: (thread_id = ANY ('{9d69894b-89a9-464b-a48f-4fba36dbd1d2,de30664a-7123-44f1-a890-3c33daab83a9,deec5953-2cf5-46a4-abd9-78f00b5c7b79,d49a2f12-08b6-40e4-a3c3-ccd41220be76,8151f56f-f21c-47aa-9992-a21c533ba326,9e1b8bab-395f-419e-99d1-e5517328d1f0,ee447c1a-0fa4-46ab-ae39-7577e0b075ea,188f7e23-728d-4690-9120-34802ed84c32,a5e7fb46-5c44-44e0-8e0a-f762e2779250,2937ac4f-dada-458d-b487-511e0862c3e8,b538c83c-2ef5-4dc8-8b0c-484cdd5d84fc,1a9bd131-16b6-4f4f-aa2d-532d4eaa7b00,b538b4a8-24ef-4bb2-844f-16b0b5e8f344,9bfb801e-1795-432d-af47-2421bdb9b8e0,3cbb0cc2-f29a-4e89-90a1-824044268a74,9ae24510-2eb8-4392-a362-ef45c05180e8,8d6933e6-6479-4d0a-92a6-4e4b1dab345c,4b4e3034-db7c-49b2-a8d1-243ca29ca400,467d79b8-a88e-45eb-a5ae-7d9de41b69fa,21c2ebdd-cfba-4bd6-81c0-807a09b695db,a1aea62b-0962-4577-af95-ea54efee852c,f38ed5e1-7996-42c5-84ab-4d10dad8c921,98c041ed-6ffd-4129-b575-d37ea6e6fcd6,36e726dc-820e-44ec-a67c-5cd189fd1a01,0c127f05-8c44-441c-8ed7-496a1ff14031,31e62fd3-bc9d-4c7d-a792-e5b3c6a5519e,1b7ca333-7d17-4f16-9624-756002796e3b,349e3641-3668-4404-80d5-839f9765324a,f073ba09-d641-4901-9a42-bcb6bacc8ecd,4e0defd5-9a48-4c9a-94ba-6cc74e86a2f4,68526f71-eff9-441d-9a0b-7205d2e4894f,eef6f4cc-69b9-4908-a986-e4fc322b8277,e09b36b1-9375-4d1e-92dd-18f19f8d2e5c,ad31788a-2fda-49f6-9ed3-3049679cffa3,ef8c8f8c-e5b9-4748-8b4b-813240343540,55facaf7-a977-44cf-9979-c329e1cd36a2,c518ac53-2ecb-4609-9745-e8a646cdd527,f2a71cb5-8fd9-4884-8338-a81f6187a90c,1c8958aa-1f93-4bd8-949d-43097b7ad558}'::uuid[]))
11. 0.455 0.455 ↑ 1.0 1 91

Index Scan using idx_organization_type_provider_id on organization sender_organization (cost=0.14..0.29 rows=1 width=128) (actual time=0.003..0.005 rows=1 loops=91)

  • Index Cond: (type = message.sender_organization_type)
  • Filter: (message.sender_organization_id = id)
  • Rows Removed by Filter: 18