explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 9DKD

Settings
# exclusive inclusive rows x rows loops node
1. 0.268 6.612 ↑ 2.2 391 1

Sort (cost=16,714.92..16,717.05 rows=854 width=282) (actual time=6.582..6.612 rows=391 loops=1)

  • Sort Key: message.date_created, message.thread_id
  • Sort Method: quicksort Memory: 226kB
2. 0.809 6.344 ↑ 2.2 391 1

GroupAggregate (cost=16,651.99..16,673.34 rows=854 width=282) (actual time=5.533..6.344 rows=391 loops=1)

  • Group Key: message.id, sender_organization.id, sender_organization.type
3. 0.330 5.535 ↑ 2.2 397 1

Sort (cost=16,651.99..16,654.12 rows=854 width=361) (actual time=5.512..5.535 rows=397 loops=1)

  • Sort Key: message.id, sender_organization.id, sender_organization.type
  • Sort Method: quicksort Memory: 229kB
4. 0.246 5.205 ↑ 2.2 397 1

Nested Loop (cost=450.23..16,610.40 rows=854 width=361) (actual time=0.331..5.205 rows=397 loops=1)

5. 0.000 3.371 ↑ 2.2 397 1

Nested Loop (cost=449.81..16,222.12 rows=854 width=275) (actual time=0.315..3.371 rows=397 loops=1)

6. 0.148 2.208 ↑ 2.1 391 1

Nested Loop (cost=449.38..9,506.20 rows=835 width=250) (actual time=0.306..2.208 rows=391 loops=1)

7. 0.232 0.496 ↑ 2.1 391 1

Bitmap Heap Scan on message (cost=448.96..3,466.80 rows=835 width=192) (actual time=0.288..0.496 rows=391 loops=1)

  • Recheck Cond: (thread_id = ANY ('{619dd6ee-b39d-4a68-b24e-192f175e577e,6a243d2c-0743-4613-9f89-06d4ed4f555b,127d0c7f-d412-4cc1-92eb-d456487b329b,b52071fc-7e7e-4bfe-ba6c-e39119bde590,14d1bc90-469c-4970-bcb6-908589338611 (...)
  • Heap Blocks: exact=194
8. 0.264 0.264 ↑ 2.1 391 1

Bitmap Index Scan on idx_message_thread_id (cost=0.00..448.75 rows=835 width=0) (actual time=0.263..0.264 rows=391 loops=1)

  • Index Cond: (thread_id = ANY ('{619dd6ee-b39d-4a68-b24e-192f175e577e,6a243d2c-0743-4613-9f89-06d4ed4f555b,127d0c7f-d412-4cc1-92eb-d456487b329b,b52071fc-7e7e-4bfe-ba6c-e39119bde590,14d1bc90-469c-4970-bcb6-90858933 (...)
9. 1.564 1.564 ↑ 1.0 1 391

Index Scan using pk_participant_id_participant_type on organization sender_organization (cost=0.42..7.23 rows=1 width=87) (actual time=0.004..0.004 rows=1 loops=391)

  • Index Cond: ((id = message.sender_organization_id) AND (type = message.sender_organization_type))
10. 1.173 1.173 ↑ 1.0 1 391

Index Scan using idx_message_recipient_message_id on message_recipient (cost=0.43..8.03 rows=1 width=41) (actual time=0.002..0.003 rows=1 loops=391)

  • Index Cond: (message_id = message.id)
11. 1.588 1.588 ↑ 1.0 1 397

Index Scan using pk_participant_id_participant_type on organization recipient (cost=0.42..0.45 rows=1 width=155) (actual time=0.004..0.004 rows=1 loops=397)

  • Index Cond: ((id = message_recipient.organization_id) AND (type = message_recipient.organization_type))