By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
CREATE TABLE
CREATE TABLE
INSERT 0 3
INSERT 0 9
CREATE INDEX
| count |
|---|
| 3 |
SELECT 1
SET
| QUERY PLAN |
|---|
| Aggregate (cost=10000001689.81..10000001689.82 rows=1 width=8) |
| -> Nested Loop (cost=10000000827.67..10000001689.30 rows=202 width=4) |
| -> Seq Scan on b (cost=10000000000.00..10000000025.88 rows=2 width=4) |
| Filter: (org_name ~~ '%myorg%'::text) |
| -> CTE Scan on t (cost=827.67..829.69 rows=101 width=4) |
| CTE t |
| -> Recursive Union (cost=0.14..827.67 rows=101 width=4) |
| -> Limit (cost=0.14..8.15 rows=1 width=4) |
| -> Index Only Scan using foo_idx on a (cost=0.14..8.15 rows=1 width=4) |
| Index Cond: (org_id = $1) |
| -> WorkTable Scan on t t_1 (cost=0.00..81.75 rows=10 width=4) |
| Filter: (created_by IS NOT NULL) |
EXPLAIN