Re: Very Slow Query - Mailing list pgsql-novice

From Josh Berkus
Subject Re: Very Slow Query
Date
Msg-id 200207311127.35854.josh@agliodbs.com
Whole thread Raw
List pgsql-novice
Chad,

> CREATE OR REPLACE FUNCTION phonenum_substr (varchar)
> RETURNS VARCHAR AS '
> SELECT substr(cr.phonenum, 1, 6) as phonenum
>
> --is cr.phonenum supposed to be $1?
>
> from call_results_fixed cr;
> ' LANGUAGE 'sql' WITH (ISCACHABLE, ISSTRICT);

OOOps!  Sorry, got confused:

CORRECT Function is:

CREATE OR REPLACE FUNCTION phonenum_substr (varchar)
RETURNS VARCHAR AS '
SELECT substr($1, 1, 6);
 ' LANGUAGE 'sql' WITH (ISCACHABLE, ISSTRICT);

-Josh

--
-Josh Berkus
 Aglio Database Solutions
 San Francisco


pgsql-novice by date:

Previous
From: "Henshall, Stuart - WCP"
Date:
Subject: Re: Very slow query
Next
From: "Chad Thompson"
Date:
Subject: Re: Very Slow Query