Re: COPY and heap_sync
От | Jeff Janes |
---|---|
Тема | Re: COPY and heap_sync |
Дата | |
Msg-id | CAMkU=1zOi9Npj8He8EOuMAgH-Sb2k_i5KoKoauqmpvwRFuE3Nw@mail.gmail.com обсуждение исходный текст |
Ответ на | Re: COPY and heap_sync (Peter Eisentraut <peter_e@gmx.net>) |
Список | pgsql-hackers |
<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Sun, Aug 31, 2014 at 6:10 AM, Peter Eisentraut <spandir="ltr"><<a href="mailto:peter_e@gmx.net" target="_blank">peter_e@gmx.net</a>></span> wrote:<br /><blockquoteclass="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="">On 8/30/142:26 AM, Jeff Janes wrote:<br /> > But there cases were people use COPY in a loop with a small amount of<br />> data in each statement.<br /><br /></div>What would be the reason for doing that?<br /><br /></blockquote></div><br/></div><div class="gmail_extra">As far as I can tell, DRY. They need code to do bulk inserts anyway. So, just use that everywhere even when it is not in bulk.</div><div class="gmail_extra"><br /></div><div class="gmail_extra">Also,you can't interleave a copy command with other queries on the same connection. So you code it tostart a COPY, use it until you discover you need to run a query (because you encounter something not in you local cache),end the COPY and do that query, then restart the query. </div><div class="gmail_extra"><br /></div><div class="gmail_extra">Undersome conditions, the interruption occurs very seldom, under other conditions it is pretty much everyrow.</div><div class="gmail_extra"><br /></div><div class="gmail_extra"> Cheers,</div><div class="gmail_extra"><br /></div><divclass="gmail_extra">Jeff</div></div>
В списке pgsql-hackers по дате отправления: