Re: Losing memory references - SRF + SPI
От | Michael Paquier |
---|---|
Тема | Re: Losing memory references - SRF + SPI |
Дата | |
Msg-id | CAB7nPqR1ABv1a9LAeYHXodoCjnaQuJjXCZf-zVet19rKDvXn1g@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: Losing memory references - SRF + SPI (Anderson Carniel <accarniel@gmail.com>) |
Список | pgsql-hackers |
On Sun, May 15, 2016 at 10:22 AM, Anderson Carniel <accarniel@gmail.com> wrote: > Thank you very much Joe. > > I have followed the crosstab() implementation and understood the idea of per > query memory context. Now, I am using a unique SPI instance (which I perform > several sql queries), process the result, transform my result into a > tuplestore, close the SPI and done. It works perfectly. > > I have a curiosity with regard to the tuplestore: is there a problem with > performance if my tuplestore form a big table with million of tuples? Other > question is regarding to SPI: is there a problem to use only one instance > of SPI (for instance, if multiple users call the same function)? When using a tuplestore, one concern for performance is the moment data is going to spill into disk, something that is set with maxKBytes in tuplestore_begin_heap(). Using work_mem is the recommendation, though you could tune it better depending on your needs. -- Michael
В списке pgsql-hackers по дате отправления: