By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0.
SELECT 3
| QUERY PLAN |
|---|
| Hash Join (cost=0.10..36.86 rows=1 width=48) |
| Hash Cond: ((l.id1 = "*VALUES*".column1) AND (l.id2 = "*VALUES*".column2) AND (l.id3 = "*VALUES*".column3) AND (l.id4 = "*VALUES*".column4)) |
| -> Seq Scan on links l (cost=0.00..20.70 rows=1070 width=48) |
| -> Hash (cost=0.04..0.04 rows=3 width=16) |
| -> Values Scan on "*VALUES*" (cost=0.00..0.04 rows=3 width=16) |
EXPLAIN
| id1 | id2 | id3 | id4 | content |
|---|---|---|---|---|
| 1 | 2 | 3 | 4 | Text |
| 1 | 2 | 5 | 4 | Other thing |
| 1 | 2 | 5 | 4 | Other thing |
SELECT 3
| id1 | id2 | id3 | id4 | content |
|---|---|---|---|---|
| 1 | 2 | 3 | 4 | Text |
| 1 | 2 | 5 | 4 | Other thing |
SELECT 2