EXPLAIN ANALYZE

Query plan for the launched search

Daitch-Mokotoff + Levenshtein

Searching for: TABITHA MAGDALENO (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"), TABITHA, 2) AS "_fn_dist", levenshtein_less_equal(UPPER("records_courtrecord"."last_name"), MAGDALENO, 2) AS "_ln_dist" FROM "records_courtrecord" WHERE (((DAITCH_MOKOTOFF(first_name) && DAITCH_MOKOTOFF(TABITHA)) AND (DAITCH_MOKOTOFF(last_name) && DAITCH_MOKOTOFF(MAGDALENO))) AND "records_courtrecord"."date_of_birth" = 1990-01-01 AND levenshtein_less_equal(UPPER("records_courtrecord"."first_name"), TABITHA, 2) <= 2 AND levenshtein_less_equal(UPPER("records_courtrecord"."last_name"), MAGDALENO, 2) <= 2) LIMIT 200

Query plan

EXPLAIN (ANALYZE, BUFFERS)

Limit  (cost=1495.32..1507.84 rows=1 width=72) (actual time=70.072..70.114 rows=1.00 loops=1)
  Buffers: shared hit=23 read=63
  ->  Bitmap Heap Scan on records_courtrecord  (cost=1495.32..1507.84 rows=1 width=72) (actual time=70.070..70.111 rows=1.00 loops=1)
        Recheck Cond: ((date_of_birth = '1990-01-01'::date) AND (daitch_mokotoff((first_name)::text) && '{373000}'::text[]))
        Filter: ((daitch_mokotoff((last_name)::text) && '{653860}'::text[]) AND (levenshtein_less_equal(upper((first_name)::text), 'TABITHA'::text, 2) <= 2) AND (levenshtein_less_equal(upper((last_name)::text), 'MAGDALENO'::text, 2) <= 2))
        Rows Removed by Filter: 8
        Heap Blocks: exact=9
        Buffers: shared hit=23 read=63
        ->  BitmapAnd  (cost=1495.32..1495.32 rows=11 width=0) (actual time=69.860..69.861 rows=0.00 loops=1)
              Buffers: shared hit=8 read=63
              ->  Bitmap Index Scan on idx_person_date_of_birth  (cost=0.00..19.54 rows=2236 width=0) (actual time=0.291..0.291 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_first_name_dm  (cost=0.00..1475.53 rows=270000 width=0) (actual time=67.882..67.882 rows=273037.00 loops=1)
                    Index Cond: (daitch_mokotoff((first_name)::text) && '{373000}'::text[])
                    Index Searches: 1
                    Buffers: shared hit=2 read=63
Planning:
  Buffers: shared hit=325
Planning Time: 1.994 ms
Execution Time: 70.252 ms