explain.depesz.com

PostgreSQL's explain analyze made readable

Result: PirI : Optimization for: plan #SKhy

Settings

Optimization path:

Optimization(s) for this plan:

# exclusive inclusive rows x rows loops node
1. 0.001 32,140.842 ↓ 0.0 0 1

Limit (cost=1,782,748.81..1,782,748.83 rows=10 width=20) (actual time=32,140.842..32,140.842 rows=0 loops=1)

2. 0.005 32,140.841 ↓ 0.0 0 1

Sort (cost=1,782,748.81..1,782,751.00 rows=877 width=20) (actual time=32,140.841..32,140.841 rows=0 loops=1)

  • Sort Key: (COALESCE(CASE WHEN ((original_mr_no)::text = ''::text) THEN NULL::character varying ELSE original_mr_no END, mr_no))
  • Sort Method: quicksort Memory: 25kB
3. 0.005 32,140.836 ↓ 0.0 0 1

HashAggregate (cost=1,782,718.89..1,782,729.86 rows=877 width=20) (actual time=32,140.836..32,140.836 rows=0 loops=1)

4. 32,140.831 32,140.831 ↓ 0.0 0 1

Seq Scan on patient_details pd (cost=0.00..1,782,714.51 rows=877 width=20) (actual time=32,140.831..32,140.831 rows=0 loops=1)

  • Filter: (((reverse(mr_no))::text ~~ '%RSMC00206421%'::text) OR (lower((government_identifier)::text) ~~ '%RSMC00206421%'::text) OR ((reverse(COALESCE(oldmrno, ''::character varying)))::text ~~ '%RSMC00206421%'::text) OR ((reverse(COALESCE(original_mr_no, ''::character varying)))::text ~~ '%RSMC00206421%'::text))
  • Rows Removed by Filter: 2,192,341
Total runtime : 32,140.888 ms