explain.depesz.com

PostgreSQL's explain analyze made readable

Result: qlXi

Settings
# exclusive inclusive rows x rows loops node
1. 0.196 44.898 ↑ 1.8 584 1

Nested Loop (cost=532.50..17,063.49 rows=1,024 width=260) (actual time=0.221..44.898 rows=584 loops=1)

2. 0.030 0.030 ↑ 1.0 32 1

Values Scan on "*VALUES*" (cost=0.00..0.40 rows=32 width=16) (actual time=0.005..0.030 rows=32 loops=1)

3. 0.128 44.672 ↑ 1.8 18 32

Limit (cost=532.50..532.58 rows=32 width=244) (actual time=1.391..1.396 rows=18 loops=32)

4. 6.560 44.544 ↑ 2.8 18 32

Sort (cost=532.50..532.63 rows=51 width=244) (actual time=1.389..1.392 rows=18 loops=32)

  • Sort Key: message."timestamp" DESC, message.sort DESC
  • Sort Method: quicksort Memory: 32kB
5. 4.604 37.984 ↓ 5.7 293 32

Nested Loop Left Join (cost=4.97..531.06 rows=51 width=244) (actual time=0.049..1.187 rows=293 loops=32)

6. 4.096 5.216 ↓ 5.7 293 32

Bitmap Heap Scan on message (cost=4.68..150.99 rows=51 width=140) (actual time=0.043..0.163 rows=293 loops=32)

  • Recheck Cond: (chat_id = "*VALUES*".column1)
  • Heap Blocks: exact=1365
7. 1.120 1.120 ↓ 5.7 293 32

Bitmap Index Scan on message_chat_id_index (cost=0.00..4.67 rows=51 width=0) (actual time=0.035..0.035 rows=293 loops=32)

  • Index Cond: (chat_id = "*VALUES*".column1)
8. 28.164 28.164 ↑ 1.0 1 9,388

Index Scan using regular_message_id_index on regular_message (cost=0.29..7.44 rows=1 width=104) (actual time=0.002..0.003 rows=1 loops=9,388)

  • Index Cond: (id = message.regular_message_id)