explain.depesz.com

PostgreSQL's explain analyze made readable

Result: mt4g

Settings
# exclusive inclusive rows x rows loops node
1. 1,926.923 2,917.590 ↓ 1.9 314,757 1

Bitmap Heap Scan on leads (cost=206,263.87..740,753.76 rows=163,055 width=4) (actual time=2,265.611..2,917.590 rows=314,757 loops=1)

  • Recheck Cond: ((created_at > '2018-09-03 07:00:00'::timestamp without time zone) AND (is_deal OR ((stage)::text = 'intro_pending'::text)))
  • Filter: ((is_deal AND (hashed SubPlan 1)) OR (((stage)::text = 'intro_pending'::text) AND ((user_type)::text = ANY ('{buyer,seller}'::text[]))))
  • Rows Removed by Filter: 5,751
  • Heap Blocks: exact=250,646
  • Functions: 22
  • Options: Inlining true, Optimization true, Expressions true, Deforming true
  • Timing: Generation 5.853 ms, Inlining 12.626 ms, Optimization 600.216 ms, Emission 435.862 ms, Total 1054.558 ms
2. 32.339 409.833 ↓ 0.0 0 1

BitmapAnd (cost=76,059.78..76,059.78 rows=324,744 width=0) (actual time=409.833..409.833 rows=0 loops=1)

3. 224.593 224.593 ↓ 1.0 1,536,569 1

Bitmap Index Scan on index_leads_on_created_at (cost=0.00..33,083.74 rows=1,515,768 width=0) (actual time=224.593..224.593 rows=1,536,569 loops=1)

  • Index Cond: (created_at > '2018-09-03 07:00:00'::timestamp without time zone)
4. 0.002 152.901 ↓ 0.0 0 1

BitmapOr (cost=42,967.84..42,967.84 rows=550,206 width=0) (actual time=152.901..152.901 rows=0 loops=1)

5. 151.955 151.955 ↓ 1.0 549,954 1

Bitmap Index Scan on index_leads_on_is_deal (cost=0.00..42,666.54 rows=546,956 width=0) (actual time=151.955..151.955 rows=549,954 loops=1)

  • Index Cond: (is_deal = true)
6. 0.944 0.944 ↓ 1.2 3,775 1

Bitmap Index Scan on index_leads_on_stage (cost=0.00..284.99 rows=3,250 width=0) (actual time=0.944..0.944 rows=3,775 loops=1)

  • Index Cond: ((stage)::text = 'intro_pending'::text)
7.          

SubPlan (for Bitmap Heap Scan)

8. 491.506 580.834 ↑ 1.1 866,363 1

Bitmap Heap Scan on provider_leads (cost=12,093.54..129,749.16 rows=909,861 width=4) (actual time=134.793..580.834 rows=866,363 loops=1)

  • Recheck Cond: ((stage)::text = ANY ('{introduced,agent_left_vm,connected,meeting_scheduled,met_in_person,coming_soon,listing,in_escrow,closed,closed_booked,closed_paid,failed}'::text[]))
  • Filter: ((created_at > '2018-09-03 00:00:00'::timestamp without time zone) AND ((providable_type)::text = 'AgentLead'::text))
  • Rows Removed by Filter: 511,487
  • Heap Blocks: exact=104,829
9. 89.328 89.328 ↑ 1.0 1,377,850 1

Bitmap Index Scan on provider_leads_stage_test (cost=0.00..12,048.04 rows=1,425,803 width=0) (actual time=89.328..89.328 rows=1,377,850 loops=1)

  • Index Cond: ((stage)::text = ANY ('{introduced,agent_left_vm,connected,meeting_scheduled,met_in_person,coming_soon,listing,in_escrow,closed,closed_booked,closed_paid,failed}'::text[]))
Planning time : 0.360 ms
Execution time : 2,942.595 ms