By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
2 rows affected
| id | js |
|---|---|
| 1 | {"user_info": [{"name": "Team member 1", "email": "abc@xyz.com", "employee_id": "1"}, {"name": "Team member 2", "email": "def@xyz.com", "employee_id": "2"}]} |
| id | js |
|---|---|
| 1 | {"user_info": [{"name": "Team member 1", "email": "abc@xyz.com", "employee_id": "1"}, {"name": "Team member 2", "email": "def@xyz.com", "employee_id": "2"}]} |
| QUERY PLAN |
|---|
| Bitmap Heap Scan on tbl (cost=8.00..12.01 rows=1 width=36) |
| Recheck Cond: (js @> '{"user_info": [{"email": "abc@xyz.com"}]}'::jsonb) |
| -> Bitmap Index Scan on tbl_js_path_ops_idx (cost=0.00..8.00 rows=1 width=0) |
| Index Cond: (js @> '{"user_info": [{"email": "abc@xyz.com"}]}'::jsonb) |
| QUERY PLAN |
|---|
| Bitmap Heap Scan on tbl (cost=8.00..12.01 rows=1 width=36) |
| Recheck Cond: (js @? '$."user_info"[*]."email"?(@ == "abc@xyz.com")'::jsonpath) |
| -> Bitmap Index Scan on tbl_js_path_ops_idx (cost=0.00..8.00 rows=1 width=0) |
| Index Cond: (js @? '$."user_info"[*]."email"?(@ == "abc@xyz.com")'::jsonpath) |