Re: Functions too slow, even with iscachable?
От | Ross J. Reedstrom |
---|---|
Тема | Re: Functions too slow, even with iscachable? |
Дата | |
Msg-id | 20000807094753.A26007@rice.edu обсуждение исходный текст |
Ответ на | Functions too slow, even with iscachable? (Ang Chin Han <angch@pintoo.com>) |
Список | pgsql-sql |
On Mon, Aug 07, 2000 at 05:11:10PM +0800, Ang Chin Han wrote: > I have a query which runs fast: > > SELECT passwd FROM ticket WHERE name = ticket2name('test-006kdt') AND > survey_id = ticket2survey_id('test-006kdt'); > > But slows down to a crawl when I wrapped it in a function: > > CREATE FUNCTION ticket2passwd(text) RETURNS text AS > 'SELECT passwd FROM ticket WHERE name = ticket2name($1) AND > ticket2survey_id($1)' LANGUAGE 'sql' WITH (iscachable); Is this a cut-n-paste error, or did you drop half a term from your WHERE clause? "survey_id =" seems to be missing in the functional form. I din't see how that would make it run slowly, however. Ross -- Ross J. Reedstrom, Ph.D., <reedstrm@rice.edu> NSBRI Research Scientist/Programmer Computer and Information Technology Institute Rice University, 6100 S. Main St., Houston, TX 77005
В списке pgsql-sql по дате отправления: