Searching for: TABITHA MAGDALENO (Jan. 1, 1990)
Explaining: soundex
Phonetic pre-filter using SOUNDEX codes.
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" FROM "records_courtrecord" WHERE (((SOUNDEX(first_name) = SOUNDEX(TABITHA)) AND (SOUNDEX(last_name) = SOUNDEX(MAGDALENO))) AND "records_courtrecord"."date_of_birth" = 1990-01-01) LIMIT 200
Query plan
EXPLAIN (ANALYZE, BUFFERS)
Limit (cost=2297.25..2309.59 rows=1 width=64) (actual time=2.329..2.331 rows=1.00 loops=1)
Buffers: shared hit=17
-> Bitmap Heap Scan on records_courtrecord (cost=2297.25..2309.59 rows=1 width=64) (actual time=2.327..2.328 rows=1.00 loops=1)
Recheck Cond: ((date_of_birth = '1990-01-01'::date) AND (soundex((first_name)::text) = 'T130'::text))
Filter: (soundex((last_name)::text) = 'M234'::text)
Rows Removed by Filter: 1
Heap Blocks: exact=2
Buffers: shared hit=17
-> BitmapAnd (cost=2297.25..2297.25 rows=11 width=0) (actual time=2.258..2.259 rows=0.00 loops=1)
Buffers: shared hit=15
-> Bitmap Index Scan on idx_person_date_of_birth (cost=0.00..19.54 rows=2236 width=0) (actual time=0.450..0.451 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_soundex (cost=0.00..2277.47 rows=270000 width=0) (actual time=1.624..1.624 rows=6903.00 loops=1)
Index Cond: (soundex((first_name)::text) = 'T130'::text)
Index Searches: 1
Buffers: shared hit=9
Planning:
Buffers: shared hit=277
Planning Time: 2.787 ms
Execution Time: 2.432 ms