explain.depesz.com

PostgreSQL's explain analyze made readable

Result: DYsS

Settings
# exclusive inclusive rows x rows loops node
1. 0.009 32,336.923 ↑ 10,937.0 1 1

Sort (cost=1,774,007.99..1,774,035.33 rows=10,937 width=20) (actual time=32,336.923..32,336.923 rows=1 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
2. 0.039 32,336.914 ↑ 10,937.0 1 1

HashAggregate (cost=1,773,137.57..1,773,274.29 rows=10,937 width=20) (actual time=32,336.909..32,336.914 rows=1 loops=1)

3. 32,336.875 32,336.875 ↑ 10,989.0 1 1

Seq Scan on patient_details pd (cost=0.00..1,773,082.63 rows=10,989 width=20) (actual time=8,237.599..32,336.875 rows=1 loops=1)

  • Filter: (((reverse(mr_no))::text ~~ '337210NOC'::text) OR (lower((government_identifier)::text) ~~ '337210NOC'::text) OR ((reverse(COALESCE(oldmrno, ''::character varying)))::text ~~ '337210NOC'::text) OR ((reverse(COALESCE(original_mr_no, ''::character varying)))::text ~~ '337210NOC'::text))
  • Rows Removed by Filter: 2,192,771