Re: Very Slow Query

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: "Chad Thompson" <chad(at)weblinkservices(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: Very Slow Query
Date: 2002-07-31 18:27:35
Message-ID: 200207311127.35854.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Mark Moser 2002-07-31 18:31:59 total newbie question: windows download (binary)
Previous Message Henshall, Stuart - WCP 2002-07-31 08:42:59 Re: Very slow query