Re: Queries within a function

От: Tom Lane
Тема: Re: Queries within a function
Дата: ,
Msg-id: 29024.1265138879@sss.pgh.pa.us
(см: обсуждение, исходный текст)
Ответ на: Queries within a function  (Mridula Mahadevan)
Ответы: Re: Queries within a function  (Mridula Mahadevan)
Список: pgsql-performance

Скрыть дерево обсуждения

Queries within a function  (Mridula Mahadevan, )
 Re: Queries within a function  (Pavel Stehule, )
 Re: Queries within a function  (Tom Lane, )
  Re: Queries within a function  (Mridula Mahadevan, )
 Re: Queries within a function  ("Ing. Marcos Orti­z Valmaseda", )
  Re: Queries within a function  (Mridula Mahadevan, )
 Re: Queries within a function  ("ramasubramanian", )
 Re: Queries within a function  (Віталій Тимчишин, )
  Re: Queries within a function  (Mridula Mahadevan, )

Mridula Mahadevan <> writes:
>  I am running a bunch of queries within a function, creating some temp tables and populating them. When the data
exceedssay, 100k the queries start getting really slow and timeout (30 min). when these are run outside of a
transaction(inauto commit mode), they run in a few seconds. Any ideas on what may be going on and any postgresql.conf
parametersetc that might help? 

I'll bet the function is caching query plans that stop being appropriate
once the table grows in size.  You might have to resort to using
EXECUTE, although if you're on 8.4 DISCARD PLANS ought to help too.

            regards, tom lane


В списке pgsql-performance по дате сообщения:

От: Tom Lane
Дата:
Сообщение: Re: queries with subquery constraints on partitioned tables not optimized?
От: wyx6fox@sina.com
Дата:
Сообщение: some problems when i use postgresql 8.4.2 in my projects .