Re: Bulk Inserts

Поиск
Список
Период
Сортировка
От Pierre Frédéric Caillaud
Тема Re: Bulk Inserts
Дата
Msg-id op.uz9hk3hqcke6l8@soyouz
обсуждение исходный текст
Ответ на Bulk Inserts  (Pierre Frédéric Caillaud<lists@peufeu.com>)
Ответы Re: Bulk Inserts  (Jeff Janes <jeff.janes@gmail.com>)
Список pgsql-hackers
Replying to myself...

Jeff suggested to build pages in local memory and insert them later in the  
table. This is what's used in CLUSTER for instance, I believe.

It has some drawbacks though :

- To insert the tuples in indexes, the tuples need tids, but if you build  
the page in local memory, you don't know on which page they will be until  
after allocating the page, which will probably be done after the page is  
built, so it's a bit of a chicken and egg problem.

- It only works on new pages. Pages which are not empty, but have free  
space, cannot be written in this way.

The little experiment I made yesterday does not have these drawbacks,  
since it allocates pages in the standard way, simply it inserts many  
tuples in one operation instead of just inserting one. If the page  
happened to be empty, it's even better, but it's not necessary. If your  
table has lots of free space, it will be used.


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

Предыдущее
От: Andrew Chernow
Дата:
Сообщение: Re: new version of PQconnectdb was:(Re: [HACKERS] Determining client_encoding from client locale)
Следующее
От: Emmanuel Cecchet
Дата:
Сообщение: Re: generic copy options