Functions too slow, even with iscachable?
| От | Ang Chin Han |
|---|---|
| Тема | Functions too slow, even with iscachable? |
| Дата | |
| Msg-id | 20000807171110.A31838@pintoo.com обсуждение исходный текст |
| Ответы |
Re: Functions too slow, even with iscachable?
Re: Functions too slow, even with iscachable? Re: Functions too slow, even with iscachable? |
| Список | pgsql-sql |
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);
which should be a shortform for the first query:
SELECT ticket2passwd('test-006kdt');
Any ideas? Thanks in advance.
ticket2name and ticket2survey_id are both iscachable.
BTW, pg_dump doesn't seem to preserve the iscachable attribute. Bug?
В списке pgsql-sql по дате отправления: