Re: Postgres delays function returning large set of data
В списке pgsql-hackers по дате отправления:
| От | Tom Lane |
|---|---|
| Тема | Re: Postgres delays function returning large set of data |
| Дата | |
| Msg-id | 7535.1244225188@sss.pgh.pa.us обсуждение |
| Ответ на | Re: Postgres delays function returning large set of data (flippo00110001 <ddevec@umich.edu>) |
| Список | pgsql-hackers |
flippo00110001 <ddevec@umich.edu> writes:
> tupstore = tuplestore_begin_heap(true, false, SortMem);
SortMem? What are you testing, 7.4?
But anyway, the question I was going to ask is whether you made sure the
data set you're trying to return fits in memory. If the tuplestore
spills to disk then it's certainly going to be a lot slower than the
function itself is.
I note that you seem to be leaking copies of all the data in the
inner loop --- it'd probably be advisable to do heap_freetuple(tup) to
avoid bloating executor memory with still a third copy of the dataset.
It might also be advisable to rethink your coding boundaries: if
getdata were to return a prefilled tuplestore instead of an array
that has to be converted into a tuplestore, you would at least save
memory space and perhaps some time too.
regards, tom lane
В списке pgsql-hackers по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера