explain.depesz.com

PostgreSQL's explain analyze made readable

Result: MswW

Settings

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 7.245 32,282.334 ↑ 784.5 11,828 1

Nested Loop (cost=1.12..555,576.29 rows=9,278,564 width=86) (actual time=5.249..32,282.334 rows=11,828 loops=1)

2. 9.089 9.089 ↓ 1.6 1,000 1

Index Scan using idx_tag on tag_history h (cost=0.56..3,482.37 rows=634 width=43) (actual time=2.896..9.089 rows=1,000 loops=1)

  • Index Cond: ((customer_id = 17) AND ((tag_vendor)::text = 'c'::text) AND ((tag_value)::text = '2266827'::text))
  • Filter: (""overlaps""(start_time_utc, stop_time_utc, '2020-01-15 00:00:00+00'::timestamp with time zone, '2020-01-20 00:00:00+00'::timestamp with time zone) AND ((location_value)::text <> ALL ('{10879,141346,141380,6768}'::text[])))
  • Rows Removed by Filter: 8211
3. 32,266.000 32,266.000 ↑ 145.2 12 1,000

Index Scan using idx_tag_history_location2 on tag_history contact (cost=0.56..853.38 rows=1,743 width=43) (actual time=15.652..32.266 rows=12 loops=1,000)

  • Index Cond: ((customer_id = 17) AND ((tag_vendor)::text = 'c'::text) AND ((location_value)::text = (h.location_value)::text))
  • Filter: (""overlaps""(h.start_time_utc, h.stop_time_utc, start_time_utc, stop_time_utc) AND (id <> h.id))
  • Rows Removed by Filter: 46548
Planning time : 0.416 ms
Execution time : 32,283.301 ms