explain.depesz.com

PostgreSQL's explain analyze made readable

Result: aP9g

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 89.455 563.218 ↓ 93.9 250,000 1

Limit (cost=15,153.36..15,160.01 rows=2,661 width=12) (actual time=408.934..563.218 rows=250,000 loops=1)

2. 186.210 473.763 ↓ 93.9 250,000 1

Sort (cost=15,153.36..15,160.01 rows=2,661 width=12) (actual time=408.932..473.763 rows=250,000 loops=1)

  • Sort Key: xact_message.send_on
  • Sort Method: external merge Disk: 6504kB
3. 101.522 287.553 ↓ 96.0 255,401 1

Nested Loop (cost=1,073.14..15,001.98 rows=2,661 width=12) (actual time=5.317..287.553 rows=255,401 loops=1)

4. 0.031 0.031 ↓ 8.0 8 1

Index Scan using xact_templatelanguage_template_id_58a8d1a4 on xact_templatelanguage u0 (cost=0.14..8.16 rows=1 width=4) (actual time=0.014..0.031 rows=8 loops=1)

  • Index Cond: (template_id = 3)
  • Filter: (state <> 2)
5. 161.736 186.000 ↓ 6.3 31,925 8

Bitmap Heap Scan on xact_message (cost=1,073.00..14,943.13 rows=5,069 width=16) (actual time=3.944..23.250 rows=31,925 loops=8)

  • Recheck Cond: (templatelanguage_id = u0.id)
  • Filter: ((state <> 2) AND (state <> ALL ('{5,6}'::integer[])) AND ((state = 4) OR (state = 3) OR ((state = 1) AND (send_on < '2019-04-09 08:19:25.89357+00'::timestamp with time zone))))
  • Rows Removed by Filter: 35562
  • Heap Blocks: exact=20577
6. 24.264 24.264 ↓ 2.4 67,487 8

Bitmap Index Scan on xact_message_templatelanguage_id_c4cf5d56 (cost=0.00..1,071.73 rows=27,641 width=0) (actual time=3.033..3.033 rows=67,487 loops=8)

  • Index Cond: (templatelanguage_id = u0.id)
Planning time : 0.267 ms
Execution time : 614.819 ms