explain.depesz.com

PostgreSQL's explain analyze made readable

Result: JlfUX : Optimization for: plan #rsCi

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 1,761.206 21,152.432 ↓ 7.3 5,696,773 1

Hash Join (cost=1,796.51..1,058,093.11 rows=782,606 width=4) (actual time=103.193..21,152.432 rows=5,696,773 loops=1)

  • Hash Cond: (mess2.conversation_id = "*VALUES*_1".column1)
2. 1,324.148 19,342.632 ↓ 7.2 5,879,466 1

Nested Loop (cost=0.56..1,045,401.47 rows=818,568 width=8) (actual time=52.898..19,342.632 rows=5,879,466 loops=1)

3. 0.354 0.354 ↑ 1.0 62 1

Values Scan on "*VALUES*" (cost=0.00..0.78 rows=62 width=4) (actual time=0.016..0.354 rows=62 loops=1)

4. 18,018.130 18,018.130 ↓ 7.2 94,830 62

Index Scan using id_direction_index on messages mess2 (cost=0.56..16,729.27 rows=13,203 width=12) (actual time=18.994..290.615 rows=94,830 loops=62)

  • Index Cond: (bot_id = "*VALUES*".column1)
  • Filter: (bot_id <> 0)
5. 20.410 48.594 ↑ 1.0 71,838 1

Hash (cost=897.98..897.98 rows=71,838 width=4) (actual time=48.594..48.594 rows=71,838 loops=1)

  • Buckets: 131072 Batches: 1 Memory Usage: 3550kB
6. 28.184 28.184 ↑ 1.0 71,838 1

Values Scan on "*VALUES*_1" (cost=0.00..897.98 rows=71,838 width=4) (actual time=0.012..28.184 rows=71,838 loops=1)

Planning time : 253.822 ms
Execution time : 21,484.199 ms