> create function f1(line text) returns void as $$ > begin > perform * from t1 where str = line; > end; > $$ language plpgsql;
This query is specifying a text comparison (text = text operator). Since the table column isn't text, a char-to-text conversion must happen at each line. > create function f2(line char) returns void as $$ > begin > perform * from t1 where str = line; > end; > $$ language plpgsql;
This query is specifying a char(n) comparison (char = char operator). No type conversion step needed, so it's faster.