explain.depesz.com

PostgreSQL's explain analyze made readable

Result: 73KVc

Settings
# exclusive inclusive rows x rows loops node
1. 0.003 6.024 ↑ 1.0 1 1

Aggregate (cost=250.51..250.52 rows=1 width=8) (actual time=6.024..6.024 rows=1 loops=1)

2. 0.004 6.021 ↑ 1.0 1 1

Nested Loop (cost=249.61..250.50 rows=1 width=0) (actual time=6.020..6.021 rows=1 loops=1)

3. 0.006 5.724 ↑ 1.0 1 1

HashAggregate (cost=249.18..249.19 rows=1 width=13) (actual time=5.724..5.724 rows=1 loops=1)

  • Group Key: contacts_notes_associations.contact_id
4. 0.003 5.718 ↑ 1.0 1 1

Nested Loop (cost=11.29..249.18 rows=1 width=13) (actual time=5.196..5.718 rows=1 loops=1)

5. 0.172 0.653 ↑ 1.0 1 1

Bitmap Heap Scan on contacts_notes (cost=11.00..12.37 rows=1 width=26) (actual time=0.651..0.653 rows=1 loops=1)

  • Recheck Cond: ((company_id = '\x4c2118ad54397f271b000000'::bytea) AND (note__tsv @@ '''test'' <-> ''note'' <-> ''text'''::tsquery))
  • Filter: (btrim(regexp_replace(nimble_contact_value_normalize(note), '<[^>]+>'::text, ' '::text, 'gi'::text)) = 'test note text'::text)
  • Heap Blocks: exact=1
6. 0.481 0.481 ↑ 1.0 1 1

Bitmap Index Scan on ft_ix_contacts__notes_note__tsv (cost=0.00..11.00 rows=1 width=0) (actual time=0.481..0.481 rows=1 loops=1)

  • Index Cond: ((company_id = '\x4c2118ad54397f271b000000'::bytea) AND (note__tsv @@ '''test'' <-> ''note'' <-> ''text'''::tsquery))
7. 5.062 5.062 ↑ 1.0 1 1

Index Only Scan using contacts_notes_associations_pkey on contacts_notes_associations (cost=0.29..236.80 rows=1 width=39) (actual time=4.542..5.062 rows=1 loops=1)

  • Index Cond: ((company_id = '\x4c2118ad54397f271b000000'::bytea) AND (note_id = contacts_notes.note_id))
  • Heap Fetches: 1
8. 0.293 0.293 ↑ 1.0 1 1

Index Only Scan using contacts_pkey on contacts (cost=0.43..1.31 rows=1 width=13) (actual time=0.293..0.293 rows=1 loops=1)

  • Index Cond: ((company_id = '\x4c2118ad54397f271b000000'::bytea) AND (id = contacts_notes_associations.contact_id))
  • Heap Fetches: 0
Planning time : 1.774 ms
Execution time : 6.117 ms