Archive for January, 2009

Select ‘X’ faster then Select 1

January 23rd, 2009

What somebody at Oracle Belgium told me once 10 years ago, I retested it on Oracle 10R2.
A Select ‘X’ is faster then a Select 1.
Stop dreaming because it’s only slightly faster.
see here the tests I did

SET time ON
SET timing ON
 
declare
v_n number;
v_c varchar2(1);
begin
FOR i IN 1..1000000 loop
SELECT ‘X’ INTO v_c FROM dual;
end loop;
end;
/
 
declare
[...]