explain.depesz.com

A tool for finding a real cause for slow queries.

Result: xcX

options
Did it help? Consider supporting us - Bitcoin address: 12v2hUztAk2LgzQ9H9LMwuU32urHMjZQnq
# exclusive inclusive rows x rows loops node
1. 0.013 1.631 ↑ 1.0 20 1

Limit (cost=39.29..4568.54 rows=20 width=420) (actual time=1.547..1.631 rows=20 loops=1)

2. 0.639 1.618 ↑ 36927273.5 20 1

Nested Loop (cost=39.29..167253054182.69 rows=738545469 width=420) (actual time=1.545..1.618 rows=20 loops=1)

  • Join Filter: (((m.messageid = dl.messageid) AND ((m.source)::text = ANY ('{+6421406411,6421406411}'::text[]))) OR (((m.destination)::text = ANY ('{+6421406411,6421406411}'::text[])) AND (dl.deliverytime >= (now() - '7 days'::interval)) AND ((dl.status)::text = 'sent'::text)))
3. 0.034 0.034 ↑ 21980356.8 5 1

Index Scan Backward using deliverylog_new_deliverytime_idx on deliverylog dl (cost=0.00..23592767.63 rows=109901784 width=202) (actual time=0.027..0.034 rows=5 loops=1)

4. 0.565 0.945 ↑ 11.9 62 5

Bitmap Heap Scan on message m (cost=39.29..1501.33 rows=738 width=218) (actual time=0.092..0.189 rows=62 loops=5)

  • Recheck Cond: ((m.messageid = dl.messageid) OR ((m.destination)::text = ANY ('{+6421406411,6421406411}'::text[])))
  • Filter: (((m.source)::text = ANY ('{+6421406411,6421406411}'::text[])) OR ((m.destination)::text = ANY ('{+6421406411,6421406411}'::text[])))
5. 0.010 0.380 ↓ 0.0 0 5

BitmapOr (cost=39.29..39.29 rows=738 width=0) (actual time=0.076..0.076 rows=0 loops=5)

6. 0.030 0.030 ↑ 1.0 1 5

Bitmap Index Scan on message_new_pkey (cost=0.00..6.60 rows=1 width=0) (actual time=0.006..0.006 rows=1 loops=5)

  • Index Cond: (m.messageid = dl.messageid)
7. 0.340 0.340 ↑ 10.1 73 5

Bitmap Index Scan on message_new_destination_idx (cost=0.00..32.69 rows=737 width=0) (actual time=0.068..0.068 rows=73 loops=5)

  • Index Cond: ((m.destination)::text = ANY ('{+6421406411,6421406411}'::text[]))