clear markdown compare help donate or buy diddy dollings comments/suggestions/bugs a leap of faith? bible365
clear markdown donate comments/suggestions/bugs a leap of faith? bible365 diddy dollings
By using db<>fiddle, you agree to license everything you submit by Creative Commons CC0. 648390 fiddles created (15114 in the last week).

create table links(id1, id2, id3, id4, content) as values (1,2,3,4,'Text') , (1,2,5,4,'Other thing') , (8,4,3,2,'More stuff');
3 rows affected
 hidden batch(es)


explain select * from links where (id1,id2,id3,id4) in ((1,2,3,4),(1,2,5,4),(8,4,3,2));
QUERY PLAN
Seq Scan on links (cost=0.00..52.80 rows=1 width=48)
Filter: (((id1 = 1) AND (id2 = 2) AND (id3 = 3) AND (id4 = 4)) OR ((id1 = 1) AND (id2 = 2) AND (id3 = 5) AND (id4 = 4)) OR ((id1 = 8) AND (id2 = 4) AND (id3 = 3) AND (id4 = 2)))
 hidden batch(es)


explain select * from links where (id1,id2,id3,id4) in ((1,2,3,4),(1,2,5,4));
QUERY PLAN
Seq Scan on links (cost=0.00..34.08 rows=1 width=48)
Filter: ((id1 = 1) AND (id2 = 2) AND (id4 = 4) AND ((id3 = 3) OR (id3 = 5)))
 hidden batch(es)