欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

PostgreSQL: Documentation: 8.3: Populating a

系統(tǒng) 2582 0

PostgreSQL: Documentation: 8.3: Populating a Database

14.4.
Populating a Database

One might need to insert a large amount of data when first
populating a database. This section contains some suggestions on
how to make this process as efficient as possible.

14.4.1. Disable
Autocommit

Turn off autocommit and just do one commit at the end. (In
plain SQL, this means issuing BEGIN at
the start and COMMIT at the end. Some
client libraries might do this behind your back, in which case
you need to make sure the library does it when you want it
done.) If you allow each insertion to be committed separately,
PostgreSQL is doing a lot of
work for each row that is added. An additional benefit of doing
all insertions in one transaction is that if the insertion of
one row were to fail then the insertion of all rows inserted up
to that point would be rolled back, so you won't be stuck with
partially loaded data.

14.4.2. Use COPY

Use COPY to load all
the rows in one command, instead of using a series of
INSERT commands. The COPY command is optimized for loading large
numbers of rows; it is less flexible than INSERT , but incurs significantly less overhead
for large data loads. Since COPY is a
single command, there is no need to disable autocommit if you
use this method to populate a table.

If you cannot use COPY , it might
help to use PREPARE
to create a prepared INSERT statement,
and then use EXECUTE as many times as
required. This avoids some of the overhead of repeatedly
parsing and planning INSERT . Different
interfaces provide this facility in different ways; look for
"prepared statements" in the
interface documentation.

Note that loading a large number of rows using COPY is almost always faster than using
INSERT , even if PREPARE is used and multiple insertions are
batched into a single transaction.

COPY is fastest when used within
the same transaction as an earlier CREATE
TABLE
or TRUNCATE command. In
such cases no WAL needs to be written, because in case of an
error, the files containing the newly loaded data will be
removed anyway. However, this consideration does not apply when
archive_mode is
set, as all commands must write WAL in that case.

PostgreSQL: Documentation: 8.3: Populating a Database


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號聯(lián)系: 360901061

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長非常感激您!手機(jī)微信長按不能支付解決辦法:請將微信支付二維碼保存到相冊,切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對您有幫助就好】

您的支持是博主寫作最大的動力,如果您喜歡我的文章,感覺我的文章對您有幫助,請用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長會非常 感謝您的哦!!!

發(fā)表我的評論
最新評論 總共0條評論
主站蜘蛛池模板: 亚洲国产中文字幕 | 欧美理伦 | 欧美一区久久 | 天天碰夜夜 | 久久中文字幕网站篠田优 | 亚洲xx站 | 99久久精品国产免看国产一区 | 色站综合 | 日本毛片爽看免费视频 | 国产你懂得| 日韩视频在线观看免费视频 | 亚洲区一| 国产福利视频一区美女 | 在线 丝袜 欧美 日韩 制服 | 成人亚洲一区 | 人人爱天天做夜夜爽 | 拍拍拍无遮挡高清视频在线网站 | 99热久久国产综合精品久久国产 | 91精品国产91久久综合 | 91视频在线观看免费 | 国产资源在线看 | 中文字幕av一区二区三区 | 性生潮久久久不久久久久 | 欧美18videosex性欧美群 | 男女视频免费在线观看 | 国产精品美女久久久久久久久久久 | 欧美综合成人 | 欧美日韩在线免费观看 | 精品免费福利视频 | 久久久久亚洲视频 | 国产精品成人自拍 | 午夜影视免费 | 欧美午夜免费观看福利片 | 美国av片在线观看 | 99久久99久久精品免费看蜜桃 | 国产乱精品一区二区三区 | 91看片在线免费观看 | 妞干网在线免费观看 | 韩国精品videosex性韩国 | 91麻豆精品国产91久久久更新资源速度超快 | 欧美日本免费 |