explain.depesz.com

PostgreSQL's explain analyze made readable

Result: UYZ1

Settings
# exclusive inclusive rows x rows loops node
1. 0.010 36,052.490 ↑ 1.0 10 1

Limit (cost=3.30..119.98 rows=10 width=196) (actual time=36,051.357..36,052.490 rows=10 loops=1)

2. 1,186.434 36,052.480 ↑ 248,328.3 10 1

Nested Loop (cost=3.30..28,975,376.15 rows=2,483,283 width=196) (actual time=36,051.350..36,052.480 rows=10 loops=1)

3. 11,057.176 11,057.176 ↑ 1.4 2,645,430 1

Index Scan using session_start_time_idx on session s (cost=0.43..3,281,980.01 rows=3,720,893 width=196) (actual time=406.480..11,057.176 rows=2,645,430 loops=1)

  • Index Cond: (start_time IS NOT NULL)
  • Filter: ((NOT published) AND (end_time IS NOT NULL))
  • Rows Removed by Filter: 5,858,903
4. 2,645.430 23,808.870 ↓ 0.0 0 2,645,430

Bitmap Heap Scan on customer c (cost=2.86..6.90 rows=1 width=42) (actual time=0.009..0.009 rows=0 loops=2,645,430)

  • Recheck Cond: (((s.customer_id)::text = (person_id)::text) OR ((s.customer_id)::text = (customer_id)::text))
  • Filter: (created_at < s.start_time)
  • Rows Removed by Filter: 0
  • Heap Blocks: exact=60,443
5. 0.000 21,163.440 ↓ 0.0 0 2,645,430

BitmapOr (cost=2.86..2.86 rows=2 width=0) (actual time=0.008..0.008 rows=0 loops=2,645,430)

6. 10,581.720 10,581.720 ↓ 0.0 0 2,645,430

Bitmap Index Scan on customer_person_id_at_idx (cost=0.00..1.43 rows=1 width=0) (actual time=0.004..0.004 rows=0 loops=2,645,430)

  • Index Cond: ((s.customer_id)::text = (person_id)::text)
7. 10,581.720 10,581.720 ↓ 0.0 0 2,645,430

Bitmap Index Scan on customer_customer_id_idx (cost=0.00..1.43 rows=1 width=0) (actual time=0.004..0.004 rows=0 loops=2,645,430)

  • Index Cond: ((s.customer_id)::text = (customer_id)::text)