explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 2Pr60

Settings
# exclusive inclusive rows x rows loops node
1. 0.177 345.970 ↑ 1.0 1 1

HashAggregate (cost=60,611.16..60,611.17 rows=1 width=28) (actual time=345.970..345.970 rows=1 loops=1)

  • Output: original.basketid, original.basketidnumerical, max(COALESCE(("substring"((restored.basketid)::text, ((original.basketid)::text || '-(\d+)'::text)))::bigint, '0'::bigint))
  • Group Key: original.basketid, original.basketidnumerical
  • Buffers: shared hit=4,967 read=1
2. 0.003 345.793 ↑ 17,243.0 1 1

Nested Loop (cost=1,482.06..60,309.41 rows=17,243 width=32) (actual time=345.790..345.793 rows=1 loops=1)

  • Output: original.basketid, original.basketidnumerical, restored.basketid
  • Buffers: shared hit=4,967 read=1
3. 0.014 0.014 ↑ 1.0 1 1

Index Scan using basket_pkey on public.basket original (cost=0.43..8.45 rows=1 width=20) (actual time=0.012..0.014 rows=1 loops=1)

  • Output: original.basketid, original.basketidnumerical
  • Index Cond: (original.id = '32375856832'::bigint)
  • Buffers: shared hit=4
4. 0.043 345.776 ↑ 17,243.0 1 1

Bitmap Heap Scan on public.basket restored (cost=1,481.63..60,128.53 rows=17,243 width=12) (actual time=345.775..345.776 rows=1 loops=1)

  • Output: restored.basketid
  • Recheck Cond: (upper((restored.basketid)::text) ~~ ((original.basketid)::text || '%'::text))
  • Heap Blocks: exact=1
  • Buffers: shared hit=4,963 read=1
5. 345.733 345.733 ↑ 17,243.0 1 1

Bitmap Index Scan on basket_reference_gin_idx (cost=0.00..1,477.32 rows=17,243 width=0) (actual time=345.733..345.733 rows=1 loops=1)

  • Index Cond: (upper((restored.basketid)::text) ~~ ((original.basketid)::text || '%'::text))
  • Buffers: shared hit=4,962 read=1
Planning time : 0.322 ms
Execution time : 346.055 ms