CREATE TABLE test(uuid text);
insert into test select uuid_generate_v4()::text from generate_series(1,1000000);
explain analyze select count(*) from (select uuid::varchar(5) from test) t1;
explain analyze select count(*) from (select left(uuid, 5) from test) t1;
explain analyze select count(*) from (select uuid::varchar(5) from test) t1;
explain analyze select count(*) from (select left(uuid, 5) from test) t1;
explain analyze select count(*) from (select uuid::varchar(5) from test) t1;
explain analyze select count(*) from (select left(uuid, 5) from test) t1;
explain analyze select count(*) from (select uuid::varchar(5) from test) t1;
explain analyze select count(*) from (select left(uuid, 5) from test) t1;