drop table if exists t1, t2, tcomp;

create table t1 (vc1 varchar(10) primary key);

insert into t1 select generate_series(1,100000)::text;

create table t2 (vc1 varchar(10) primary key, x varchar(10));

insert into t2 select x::text, (x+1)::text from generate_series(1,100000) x;

vacuum analyze t1, t2;

explain
select * from t1 where vc1 = '23' or vc1 = '24' or vc1 = '42';

set debug_print_parse = 1;
set debug_print_plan = 1;

select * from t1 where vc1 = '23' or vc1 = '24' or vc1 = '42';

explain
select t1.* from t1, t2
where t2.vc1 = '66' and (t1.vc1 = t2.x or t1.vc1 = '99');

create type complex as (r float8, i float8);

create table tcomp (f1 complex primary key);

insert into tcomp select (x,x+1)::complex from generate_series(1,100000) x;

vacuum analyze tcomp;

explain
select * from tcomp where f1 = (1,2)::complex;

select * from tcomp where f1 = (1,2)::complex;

explain
select * from tcomp where f1 = (1,2)::complex or f1 = (3,4)::complex;

select * from tcomp where f1 = (1,2)::complex or f1 = (3,4)::complex;
