Subject ORDER BY with LPAD is to slow
Author danyschaer
Hi All;

I am using FB 2.1, and I have found that LPAD slows down (60 seconds or
more for 30k records) a lot when used in a order by clause:

select "EXP1" from "PROC" order by LPAD(lower(trim("EXP1")),18)


select LPAD(lower(trim("EXP1")),18) as "XX" from "PROC" order by "XX"

But, it is very fast (0 seconds) if I do not use it in the order by

select LPAD(lower(trim("EXP1")),18) from "PROC"

Why is this?.

Thank you!