explain.depesz.com

PostgreSQL's explain analyze made readable

Result: LFYg

Settings
# exclusive inclusive rows x rows loops node
1. 101.886 1,456.056 ↑ 1.0 1 1

Aggregate (cost=32,876.42..32,876.43 rows=1 width=8) (actual time=1,456.056..1,456.056 rows=1 loops=1)

2. 1,342.975 1,354.170 ↓ 2.0 1,044,612 1

Index Only Scan using contacts_pkey on contacts (cost=249.61..31,570.02 rows=522,561 width=0) (actual time=11.502..1,354.170 rows=1,044,612 loops=1)

  • Index Cond: (company_id = '\x4c2118ad54397f271b000000'::bytea)
  • Filter: (NOT (hashed SubPlan 1))
  • Rows Removed by Filter: 1
  • Heap Fetches: 143238
3.          

SubPlan (for Index Only Scan)

4. 0.004 11.195 ↑ 1.0 1 1

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

5. 0.193 3.090 ↑ 1.0 1 1

Bitmap Heap Scan on contacts_notes (cost=11.00..12.37 rows=1 width=26) (actual time=3.089..3.090 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. 2.897 2.897 ↑ 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=2.897..2.897 rows=1 loops=1)

  • Index Cond: ((company_id = '\x4c2118ad54397f271b000000'::bytea) AND (note__tsv @@ '''test'' <-> ''note'' <-> ''text'''::tsquery))
7. 8.101 8.101 ↑ 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=7.236..8.101 rows=1 loops=1)

  • Index Cond: ((company_id = '\x4c2118ad54397f271b000000'::bytea) AND (note_id = contacts_notes.note_id))
  • Heap Fetches: 1
Planning time : 3.363 ms
Execution time : 1,459.130 ms