create extension citext;
create table test1 (tx citext unique);
create table test2 (tx text);
create unique index u_test2_tx on test2(lower(tx));
insert into test1
-- select gen_random_uuid() from generate_series(0, 1000000) union select '123e4567-e89b-12d3-a456-426655440000';
values ('hello world 1'), ('Hello world 2'), ('Hello World 3'), ('HELLO WORLD 4');
insert into test2
-- select gen_random_uuid() from generate_series(0, 1000000) union select '123e4567-e89b-12d3-a456-426655440000';
values ('hello world 1'), ('Hello world 2'), ('Hello World 3'), ('HELLO WORLD 4');
explain analyze SELECT * from test1 where tx = '123e4567-e89b-12d3-a456-426655440000';
explain analyze SELECT * from test1 where lower(tx) = lower('123e4567-e89b-12d3-a456-426655440000')