By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE
| id | title | subtitle | text_search |
|---|---|---|---|
| 1 | foo | bar | 'bar':2B 'foo':1A |
INSERT 0 1
| id | title | subtitle | text_search |
|---|---|---|---|
| 1 | foo NEW | bar | 'bar':3B 'foo':1A 'new':2A |
UPDATE 1
| id | title | subtitle | text_search |
|---|---|---|---|
| 1 | foo NEW | bar | 'bar':3B 'foo':1A 'new':2A |
SELECT 1
CREATE INDEX
SET
| QUERY PLAN |
|---|
| Bitmap Heap Scan on idea (cost=8.00..12.01 rows=1 width=104) |
| Recheck Cond: (text_search @@ '''bar'':B'::tsquery) |
| -> Bitmap Index Scan on idea_text_search_gin_idx (cost=0.00..8.00 rows=1 width=0) |
| Index Cond: (text_search @@ '''bar'':B'::tsquery) |
EXPLAIN