explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 6BI2d : Optimization for: plan #9ZWs

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.002 3,359.533 ↓ 5.0 5 1

Limit (cost=22,297.87..22,297.87 rows=1 width=12) (actual time=3,359.530..3,359.533 rows=5 loops=1)

2. 1.207 3,359.531 ↓ 5.0 5 1

Sort (cost=22,297.87..22,297.87 rows=1 width=12) (actual time=3,359.529..3,359.531 rows=5 loops=1)

  • Sort Key: (random())
  • Sort Method: top-N heapsort Memory: 25kB
3. 2.169 3,358.324 ↓ 5,193.0 5,193 1

Nested Loop (cost=19,873.00..22,297.86 rows=1 width=12) (actual time=3,075.174..3,358.324 rows=5,193 loops=1)

4. 233.330 3,278.872 ↓ 8,587.0 8,587 1

Bitmap Heap Scan on salelead_master slm (cost=19,872.57..22,289.39 rows=1 width=8) (actual time=3,061.301..3,278.872 rows=8,587 loops=1)

  • Recheck Cond: ((COALESCE(assigned_to, 0) = 0) AND (last_hot_lead_marked >= 1,595,874,600) AND (last_hot_lead_marked <= 1,596,637,965))
  • Filter: ((hot_lead IS TRUE) AND ((hide_salelead IS TRUE) IS FALSE) AND ((freeze_salelead IS TRUE) IS FALSE) AND ((lead_status)::text = 'NOT_OPEN'::text) AND (business_stream_id = 1) AND ((NULLIF(tags, ''::text) IS NULL) OR ((tags IS NOT NULL) AND ((tags_vec)::tsvector @@ to_tsquery('!EAPPMT_REGIS'::text)))))
  • Rows Removed by Filter: 18,315
  • Heap Blocks: exact=29,154
5. 301.541 3,045.542 ↓ 0.0 0 1

BitmapAnd (cost=19,872.57..19,872.57 rows=570 width=0) (actual time=3,045.542..3,045.542 rows=0 loops=1)

6. 2,719.319 2,719.319 ↓ 112.7 16,656,804 1

Bitmap Index Scan on salelead_index_assigned_to_null (cost=0.00..3,771.45 rows=147,777 width=0) (actual time=2,719.319..2,719.319 rows=16,656,804 loops=1)

7. 24.682 24.682 ↓ 1.7 197,897 1

Bitmap Index Scan on salelead_master_last_hot_lead_marked (cost=0.00..16,100.87 rows=114,031 width=0) (actual time=24.682..24.682 rows=197,897 loops=1)

  • Index Cond: ((last_hot_lead_marked >= 1,595,874,600) AND (last_hot_lead_marked <= 1,596,637,965))
8. 77.283 77.283 ↑ 1.0 1 8,587

Index Scan using profile_master_profile_id_pkey on profile_master pm (cost=0.43..8.46 rows=1 width=4) (actual time=0.008..0.009 rows=1 loops=8,587)

  • Index Cond: (profile_id = slm.profile_id)
  • Filter: (((country_code)::text = 'IN'::text) AND ((state)::text <> ALL ('{Karnataka,"Tamil Nadu","Andhra Pradesh",Telangana}'::text[])))
  • Rows Removed by Filter: 0
Planning time : 1.191 ms
Execution time : 3,359.654 ms