explain.depesz.com

PostgreSQL's explain analyze made readable

Result: Jekf : Optimization for: Optimization for: plan #b7SJ; plan #6tpr

Settings

Optimization path:

# exclusive inclusive rows x rows loops node
1. 0.002 2,107.182 ↑ 499.0 1 1

Limit (cost=288,587.65..288,588.90 rows=499 width=98) (actual time=2,107.181..2,107.182 rows=1 loops=1)

  • Buffers: shared hit=389,382
2. 0.012 2,107.180 ↑ 499.0 1 1

Sort (cost=288,587.65..288,588.90 rows=499 width=98) (actual time=2,107.180..2,107.180 rows=1 loops=1)

  • Sort Key: name
  • Sort Method: quicksort Memory: 25kB
  • Buffers: shared hit=389,382
3. 1,839.069 2,107.168 ↑ 499.0 1 1

Bitmap Heap Scan on customer (cost=61,838.78..288,565.29 rows=499 width=98) (actual time=2,088.294..2,107.168 rows=1 loops=1)

  • Recheck Cond: ((resellerid = 247,133) AND ((parentkey = '999999999_247131_247133'::text) OR (parentkey ~~ '999999999\_247131\_247133\%'::text)))
  • Filter: ((customerstatus <> 'Deleted'::text) AND ((parentkey = '999999999_247131_247133'::text) OR (parentkey ~~ '999999999\_247131\_247133\%'::text)) A
  • Rows Removed by Filter: 1,483,671
  • Heap Blocks: exact=373,338
  • Buffers: shared hit=389,382
4. 12.899 268.099 ↓ 0.0 0 1

BitmapAnd (cost=61,838.78..61,838.78 rows=100,375 width=0) (actual time=268.099..268.099 rows=0 loops=1)

  • Buffers: shared hit=16,044
5. 127.933 127.933 ↓ 1.0 1,493,949 1

Bitmap Index Scan on customer_resellerid_key1 (cost=0.00..24,784.12 rows=1,466,891 width=0) (actual time=127.933..127.933 rows=1,493,949 loops=1)

  • Index Cond: (resellerid = 247,133)
  • Buffers: shared hit=4,818
6. 127.254 127.267 ↓ 0.0 0 1

BitmapOr (cost=37,054.28..37,054.28 rows=1,467,188 width=0) (actual time=127.266..127.267 rows=0 loops=1)

  • Buffers: shared hit=11,226
  • -> Bitmap Index Scan on customer_parentkey_idx (cost=0.00..37045.24 rows=1,466,891 width=0) (actual time=127.251..127.251 rows=1,498,794 loops
  • Index Cond: (parentkey = '999999999_247131_247133'::text)
  • Buffers: shared hit=11,222
7. 0.013 0.013 ↓ 0.0 0 1

Bitmap Index Scan on customer_parentkey_idx (cost=0.00..8.79 rows=297 width=0) (actual time=0.013..0.013 rows=0 loops=1)

  • Index Cond: (parentkey = '999999999_247131_247133%'::text)
  • Buffers: shared hit=4
Planning time : 0.198 ms
Execution time : 2,108.383 ms