I tested select statement inside sql and plpgsql function,
very slow


CREATE FUNCTION geturllike(text) RETURNS SETOF text AS '
SELECT url as url FROM urlinfo WHERE url LIKE $1;
'LANGUAGE 'sql';

CREATE FUNCTION hasdup(text) RETURNS int4 AS '
declare
   v_id         int4;
   rat1         text;
   rat2         text;
   v_url        text;
   rec          record;

begin
     v_url:= $1||''%'';

     for rec in select id,url from urlinfo where url like v_url order by
url loop
        raise notice ''%'',rec.url;
     end loop;
     return 0;
end;
' LANGUAGE 'plpgsql';

Why so slow????
Is it a bug??


Jie LIANG

St. Bernard Software

10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873

[EMAIL PROTECTED]
www.stbernard.com
www.ipinc.com



---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

Reply via email to