From: | "Chad Thompson" <chad(at)weblinkservices(dot)com> |
---|---|
To: | <josh(at)agliodbs(dot)com> |
Cc: | <pgsql-novice(at)postgresql(dot)org> |
Subject: | Re: Very Slow Query |
Date: | 2002-07-31 19:25:50 |
Message-ID: | 019501c238c8$15199d10$32021aac@chad |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice |
Cool, I got it to work!
I also changed the syntax of the index that you gave me to make use of the
function
CREATE INDEX idx_cr_phonenum_substr ON
call_results_fixed(phonenum_substr(phonenum));
Thanks for everything
Chad
----- Original Message -----
From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: "Chad Thompson" <chad(at)weblinkservices(dot)com>
Cc: <pgsql-novice(at)postgresql(dot)org>
Sent: Wednesday, July 31, 2002 12:27 PM
Subject: Re:[NOVICE] Very Slow Query
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
From | Date | Subject | |
---|---|---|---|
Next Message | Jeffrey Trueblood | 2002-07-31 21:10:49 | Error Configuring PLPERL on PQSQL |
Previous Message | Janet Borschowa | 2002-07-31 18:57:13 | Re: Altering psqlodbc.h |