explain.depesz.com

A tool for finding a real cause for slow queries.

Result: Ly3 : Get bSMS status and ignore duplicates joins

options
exclusive inclusive rows x rows loops node
0.000 0.000 ↓ 0.0

Sort (cost=967014.97..967015.65 rows=269 width=17) (actual time=.. rows= loops=)

  • Sort Key: b.service_id, d.shortcode
0.000 0.000 ↓ 0.0

HashAggregate (cost=967000.75..967004.12 rows=269 width=17) (actual time=.. rows= loops=)

0.000 0.000 ↓ 0.0

Hash Join (cost=954766.02..965729.15 rows=127160 width=17) (actual time=.. rows= loops=)

  • Hash Cond: ((d.out_ext_sid)::text = (b.ext_id)::text)
0.000 0.000 ↓ 0.0

GroupAggregate (cost=473887.69..477884.59 rows=133230 width=30) (actual time=.. rows= loops=)

  • Filter: (count(*) = 1)
0.000 0.000 ↓ 0.0

Sort (cost=473887.69..474220.77 rows=133230 width=30) (actual time=.. rows= loops=)

  • Sort Key: d.out_ext_sid, d.status
0.000 0.000 ↓ 0.0

Hash Join (cost=228285.21..459358.95 rows=133230 width=30) (actual time=.. rows= loops=)

  • Hash Cond: ((d.out_ext_sid)::text = (b.ext_id)::text)
0.000 0.000 ↓ 0.0

Seq Scan on delivery_status d (cost=0.00..176048.64 rows=2491840 width=30) (actual time=.. rows= loops=)

  • Filter: (status <> ALL ('{8,4}'::integer[]))
0.000 0.000 ↓ 0.0

Hash (cost=225513.64..225513.64 rows=147006 width=25) (actual time=.. rows= loops=)

0.000 0.000 ↓ 0.0

Bitmap Heap Scan on bsms_in b (cost=6451.56..225513.64 rows=147006 width=25) (actual time=.. rows= loops=)

  • Recheck Cond: (date_trunc('month'::text, otime) = '2012-01-01 00:00:00'::timestamp without time zone)
  • Filter: (operator_id = 1)
0.000 0.000 ↓ 0.0

Bitmap Index Scan on new_bsms_in_otime_idx (cost=0.00..6414.80 rows=274949 width=0) (actual time=.. rows= loops=)

  • Index Cond: (date_trunc('month'::text, otime) = '2012-01-01 00:00:00'::timestamp without time zone)
0.000 0.000 ↓ 0.0

Hash (cost=477650.95..477650.95 rows=133230 width=70) (actual time=.. rows= loops=)

0.000 0.000 ↓ 0.0

Hash Join (cost=228428.21..477650.95 rows=133230 width=70) (actual time=.. rows= loops=)

  • Hash Cond: ((d.out_ext_sid)::text = (b.ext_id)::text)
0.000 0.000 ↓ 0.0

Seq Scan on delivery_status d (cost=0.00..176048.64 rows=2491840 width=35) (actual time=.. rows= loops=)

  • Filter: (status <> ALL ('{8,4}'::integer[]))
0.000 0.000 ↓ 0.0

Hash (cost=225513.64..225513.64 rows=147006 width=35) (actual time=.. rows= loops=)

0.000 0.000 ↓ 0.0

Bitmap Heap Scan on bsms_in b (cost=6451.56..225513.64 rows=147006 width=35) (actual time=.. rows= loops=)

  • Recheck Cond: (date_trunc('month'::text, otime) = '2012-01-01 00:00:00'::timestamp without time zone)
  • Filter: (operator_id = 1)
0.000 0.000 ↓ 0.0

Bitmap Index Scan on new_bsms_in_otime_idx (cost=0.00..6414.80 rows=274949 width=0) (actual time=.. rows= loops=)

  • Index Cond: (date_trunc('month'::text, otime) = '2012-01-01 00:00:00'::timestamp without time zone)