explain.depesz.com

PostgreSQL's explain analyze made readable

Result: hunK

Settings
# exclusive inclusive rows x rows loops node
1. 0.000 1,678.027 ↓ 54.0 3,455 1

Gather Merge (cost=484,066.80..484,074.26 rows=64 width=289) (actual time=1,661.840..1,678.027 rows=3,455 loops=1)

  • Workers Planned: 2
  • Workers Launched: 2
2. 4.842 4,958.466 ↓ 36.0 1,152 3

Sort (cost=483,066.77..483,066.85 rows=32 width=289) (actual time=1,652.619..1,652.822 rows=1,152 loops=3)

  • Sort Key: c.id DESC
  • Sort Method: quicksort Memory: 326kB
3. 4.710 4,953.624 ↓ 36.0 1,152 3

Nested Loop Left Join (cost=111,994.25..483,065.97 rows=32 width=289) (actual time=1,521.141..1,651.208 rows=1,152 loops=3)

4. 40.290 4,938.549 ↓ 36.0 1,152 3

Hash Join (cost=111,993.95..483,055.74 rows=32 width=297) (actual time=1,521.071..1,646.183 rows=1,152 loops=3)

  • Hash Cond: (pcs.time_zone_id = tz.id)
  • Join Filter: ((timezone((tz.abbr)::text, c.call_datetime) >= '2016-01-01 00:00:00'::timestamp without time zone) AND (timezone((tz.abbr)::text, c.call_datetime) <= '2016-05-30 23:59:59'::timestamp without time zone))
  • Rows Removed by Join Filter: 15554
5. 36.954 4,898.109 ↓ 58.6 16,706 3

Hash Join (cost=111,991.32..483,052.34 rows=285 width=301) (actual time=1,520.699..1,632.703 rows=16,706 loops=3)

  • Hash Cond: (c.property_id = pcs.property_id)
6. 3,337.143 4,850.649 ↑ 7.4 16,706 3

Parallel Bitmap Heap Scan on calls c (cost=111,618.20..482,354.03 rows=123,875 width=297) (actual time=1,517.168..1,616.883 rows=16,706 loops=3)

  • Recheck Cond: (((property_id = ANY ('{103618,264930,93367,189068}'::integer[])) OR ((property_id IS NULL) AND (property_id IS NOT NULL))) AND (cid = 3049))
  • Filter: ((is_test_call = 0) AND (is_auto_detected = 0) AND (call_type_id = ANY ('{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48}'::integer[])) AND (call_result_id = ANY ('{1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125,126,127,128,129,130,131,132,133,134,135,136,137,138,139,140,141}'::integer[])))
  • Rows Removed by Filter: 4
  • Heap Blocks: exact=18405
7. 15.041 1,513.506 ↓ 0.0 0 1

BitmapAnd (cost=111,618.20..111,618.20 rows=377,721 width=0) (actual time=1,513.506..1,513.506 rows=0 loops=1)

8. 0.002 13.906 ↓ 0.0 0 1

BitmapOr (cost=31,449.93..31,449.93 rows=3,055,662 width=0) (actual time=13.906..13.906 rows=0 loops=1)

9. 13.897 13.897 ↓ 2.5 50,130 1

Bitmap Index Scan on calls_property_id_idx (cost=0.00..206.28 rows=19,738 width=0) (actual time=13.897..13.897 rows=50,130 loops=1)

  • Index Cond: (property_id = ANY ('{103618,264930,93367,189068}'::integer[]))
10. 0.007 0.007 ↓ 0.0 0 1

Bitmap Index Scan on calls_property_id_idx (cost=0.00..31,095.00 rows=3,035,925 width=0) (actual time=0.007..0.007 rows=0 loops=1)

  • Index Cond: (property_id IS NULL)
11. 1,484.559 1,484.559 ↓ 1.0 7,150,447 1

Bitmap Index Scan on idx_calls_ivr_menu_action_id (cost=0.00..80,093.69 rows=7,105,750 width=0) (actual time=1,484.559..1,484.559 rows=7,150,447 loops=1)

  • Index Cond: (cid = 3049)
12. 1.224 10.506 ↓ 2.3 870 3

Hash (cost=368.40..368.40 rows=378 width=12) (actual time=3.502..3.502 rows=870 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 46kB
13. 9.282 9.282 ↓ 2.3 870 3

Index Scan using uk_property_call_settings_cid_property_id on property_call_settings pcs (cost=0.42..368.40 rows=378 width=12) (actual time=0.043..3.094 rows=870 loops=3)

  • Index Cond: (cid = 3049)
14. 0.045 0.150 ↑ 2.0 14 3

Hash (cost=2.28..2.28 rows=28 width=8) (actual time=0.049..0.050 rows=14 loops=3)

  • Buckets: 1024 Batches: 1 Memory Usage: 9kB
15. 0.105 0.105 ↑ 2.0 14 3

Seq Scan on time_zones tz (cost=0.00..2.28 rows=28 width=8) (actual time=0.022..0.035 rows=14 loops=3)

16. 10.365 10.365 ↑ 1.0 1 3,455

Index Scan using pk_call_phone_numbers on call_phone_numbers cpn (cost=0.29..0.32 rows=1 width=8) (actual time=0.003..0.003 rows=1 loops=3,455)

  • Index Cond: (id = c.call_phone_number_id)