EXPLAIN ANALYZE

Query plan for the launched search

Daitch-Mokotoff + Levenshtein

Searching for: JULIA NIGEL (Jan. 1, 1990)

Explaining: dm + levenshtein

Phonetic codes with stronger Slavic/Germanic coverage. Edit distance ≤ 2 — precision filter applied on top of other modes.

SQL

SELECT "records_courtrecord"."id", "records_courtrecord"."first_name", "records_courtrecord"."last_name", "records_courtrecord"."middle_name", "records_courtrecord"."date_of_birth", "records_courtrecord"."nicknames", "records_courtrecord"."person_id", levenshtein_less_equal(UPPER("records_courtrecord"."first_name"), JULIA, 2) AS "_fn_dist", levenshtein_less_equal(UPPER("records_courtrecord"."last_name"), NIGEL, 2) AS "_ln_dist" FROM "records_courtrecord" WHERE (((DAITCH_MOKOTOFF(first_name) && DAITCH_MOKOTOFF(JULIA)) AND (DAITCH_MOKOTOFF(last_name) && DAITCH_MOKOTOFF(NIGEL))) AND "records_courtrecord"."date_of_birth" = 1990-01-01 AND levenshtein_less_equal(UPPER("records_courtrecord"."first_name"), JULIA, 2) <= 2 AND levenshtein_less_equal(UPPER("records_courtrecord"."last_name"), NIGEL, 2) <= 2) LIMIT 200

Query plan

EXPLAIN (ANALYZE, BUFFERS)

Limit  (cost=1495.32..1507.84 rows=1 width=72) (actual time=39.113..39.146 rows=7.00 loops=1)
  Buffers: shared hit=18 read=34
  ->  Bitmap Heap Scan on records_courtrecord  (cost=1495.32..1507.84 rows=1 width=72) (actual time=39.111..39.142 rows=7.00 loops=1)
        Recheck Cond: ((date_of_birth = '1990-01-01'::date) AND (daitch_mokotoff((last_name)::text) && '{658000}'::text[]))
        Filter: ((daitch_mokotoff((first_name)::text) && '{180000,480000}'::text[]) AND (levenshtein_less_equal(upper((first_name)::text), 'JULIA'::text, 2) <= 2) AND (levenshtein_less_equal(upper((last_name)::text), 'NIGEL'::text, 2) <= 2))
        Rows Removed by Filter: 3
        Heap Blocks: exact=4
        Buffers: shared hit=18 read=34
        ->  BitmapAnd  (cost=1495.32..1495.32 rows=11 width=0) (actual time=38.910..38.912 rows=0.00 loops=1)
              Buffers: shared hit=8 read=34
              ->  Bitmap Index Scan on idx_person_date_of_birth  (cost=0.00..19.54 rows=2236 width=0) (actual time=0.320..0.321 rows=2196.00 loops=1)
                    Index Cond: (date_of_birth = '1990-01-01'::date)
                    Index Searches: 1
                    Buffers: shared hit=6
              ->  Bitmap Index Scan on idx_person_last_name_dm  (cost=0.00..1475.54 rows=270000 width=0) (actual time=37.559..37.559 rows=126512.00 loops=1)
                    Index Cond: (daitch_mokotoff((last_name)::text) && '{658000}'::text[])
                    Index Searches: 1
                    Buffers: shared hit=2 read=34
Planning:
  Buffers: shared hit=325
Planning Time: 2.689 ms
Execution Time: 39.297 ms