explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2BUU : Optimization for: plan #MswW

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 6.811 34,079.860 ↑ 759.2 11,828 1

Nested Loop (cost=1.12..596,880.72 rows=8,980,045 width=86) (actual time=5.899..34,079.860 rows=11,828 loops=1)

2. 9.049 9.049 ↓ 1.6 1,000 1

Index Scan using idx_tag on tag_history h (cost=0.56..3,457.45 rows=630 width=43) (actual time=2.890..9.049 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. 34,064.000 34,064.000 ↑ 146.6 12 1,000

Index Scan using idx_location on tag_history contact (cost=0.56..924.35 rows=1,759 width=43) (actual time=15.602..34.064 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.503 ms
Execution time : 34,080.823 ms