Re: Producer/Consumer Issues in the COPY across network

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Producer/Consumer Issues in the COPY across network
Дата
Msg-id 20080228143953.GA27658@svana.org
обсуждение исходный текст
Ответ на Re: Producer/Consumer Issues in the COPY across network  (Simon Riggs <simon@2ndquadrant.com>)
Ответы Re: Producer/Consumer Issues in the COPY across network  (Simon Riggs <simon@2ndquadrant.com>)
Список pgsql-hackers
On Thu, Feb 28, 2008 at 01:57:49AM +0000, Simon Riggs wrote:
> >
> > AIUI the server merely streams the rows to you, the client doesn't get
> > to say how many :)
>
> Right, but presumably we generate a new message per PQgetCopyData()
> request? So my presumption is we need to wait for that to be generated
> each time?

No, PQgetCopyData() doesn't send anything. It merely reads what's in
the kernel socket buffer to a local buffer and when it has a complete
line it mallocs a string and returns it to you.

Similarly, PQputCopyData() doesn't expect anything from the server
during transmission.

That's why I was wondering about the rows per packet. Sending bigger
packets reduces overall overhead.

(The malloc/free per row doesn't seem too efficient.)

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: Silly Newbie question
Следующее
От: Josh Berkus
Дата:
Сообщение: Re: UUID data format 4x-4x-4x-4x-4x-4x-4x-4x