当前位置: 首页 > news >正文

海外营销公司站长工具seo推广秒收录

海外营销公司,站长工具seo推广秒收录,怎么把别人做的网站变成自己的,成都网站建设xh web文章目录 1.copy命令介紹2.copy vs insert的优势3.测量性能4.结论 1.copy命令介紹 PostgreSQL 中的命令COPY是执行批量插入和数据迁移的强大工具。它允许快速有效地将大量数据插入表中。 COPY命令为批量插入和数据迁移提供了更简单且更具成本效益的解决方案。 可以避免使用诸…

文章目录

  • 1.copy命令介紹
  • 2.copy vs insert的优势
  • 3.测量性能
  • 4.结论

1.copy命令介紹

PostgreSQL 中的命令COPY是执行批量插入和数据迁移的强大工具。它允许快速有效地将大量数据插入表中。

COPY命令为批量插入和数据迁移提供了更简单且更具成本效益的解决方案。
可以避免使用诸如:分布式处理工具、为数据库添加更多的 CPU 和 RAM的方案或者其他的加速方案
因此,如果有一个任务需要在短时间内插入大量行,可以考虑使用COPY 命令。它可以显著加快数据迁移和载入过程。
据说PostgreSQL 16 已将 COPY 的性能提高了 300% 以上
详尽的有关copy命令的语法可参考官网

2.copy vs insert的优势

Three-Column Table
COPYINSERT (multi-line)
LoggingOne log for the entire loadOne log for each line/entry
NetworkNo latency, data is streamedLatency between inserts
ParsingOnly one parsing operationParsing overhead
TransactionSingle transactionEach insert statement is a separate transaction
Query PlanSimpler query execution planLots of different query execution plans

总而言之,COPY 速度更快,因为与多行 INSERT 语句相比,它减少了日志记录、网络延迟、解析和事务管理的开销。 它允许更简单的查询执行计划,从而实现更快、更高效的批量插入和数据迁移。 一个权衡是它需要直接访问文件系统,因此它可能并不适合所有需要插入数据的场景。 另一个权衡是持久性,COPY 生成很少的日志,并在单个事务中执行所有日志,这使得它的风险更大。

3.测量性能

创建3个测试表

test=# create table t1 (id1 bigint,id2 bigint);
CREATE TABLE
Time: 7.744 ms
test=# create table t2 (id1 bigint,id2 bigint);
CREATE TABLE
Time: 8.680 ms
test=# create table t3 (id1 bigint,id2 bigint);
CREATE TABLE
Time: 0.924 ms

向t1插入1千万笔测试资料,产生size 422MB的测试表

test=# insert into t1 select generate_series(1,10000000),generate_series(10000000,1,-1);
INSERT 0 10000000
Time: 11933.658 ms (00:11.934)
test=# select count(1),pg_size_pretty(pg_relation_size('t1')) from t1;count   | pg_size_pretty 
----------+----------------10000000 | 422 MB(1 row)Time: 377.028 ms

汇出成csv文件备用

test=# \copy t2 from '/var/lib/postgresql/t1.csv';
COPY 10000000
Time: 5997.302 ms (00:05.997)

验证汇出的csv文件的数据行数与大小

postgres@pgd-prod01:~$ cat t1.csv|wc -l
10000000
postgres@pgd-prod01:~$ ls -alh|grep t1;
-rw-rw-r--  1 postgres postgres  151M Nov 18 11:26 t1.csv
test=# insert into t3 select * from t1;
INSERT 0 10000000
Time: 9811.316 ms (00:09.811)

4.结论

最后测试结果表明,COPY 命令与 INSERT 命令相比具有更高的效率,速度上的差异是相当显着的,当插入同样的1仟万笔数据时,copy费时5997.302 ms,而insert费时9811.316 ms,相较insert而言,节约40%的时间,这是在postgresql 10版本的测试,postgresql 16据说提升更多


文章转载自:
http://imputation.rgxf.cn
http://judaica.rgxf.cn
http://greenstuff.rgxf.cn
http://ruminant.rgxf.cn
http://workpaper.rgxf.cn
http://congeal.rgxf.cn
http://dado.rgxf.cn
http://ventiduct.rgxf.cn
http://diaphragmatic.rgxf.cn
http://halfvolley.rgxf.cn
http://katydid.rgxf.cn
http://jaa.rgxf.cn
http://misthink.rgxf.cn
http://baed.rgxf.cn
http://caducity.rgxf.cn
http://grandness.rgxf.cn
http://hire.rgxf.cn
http://skee.rgxf.cn
http://calcic.rgxf.cn
http://chloroacetic.rgxf.cn
http://preallotment.rgxf.cn
http://sawfly.rgxf.cn
http://velskoon.rgxf.cn
http://proser.rgxf.cn
http://blacking.rgxf.cn
http://fierily.rgxf.cn
http://jactance.rgxf.cn
http://boob.rgxf.cn
http://keelman.rgxf.cn
http://drogulus.rgxf.cn
http://impregnatable.rgxf.cn
http://hydroacoustic.rgxf.cn
http://suzuribako.rgxf.cn
http://publican.rgxf.cn
http://alacrity.rgxf.cn
http://toccata.rgxf.cn
http://nipple.rgxf.cn
http://cephalometer.rgxf.cn
http://aerophile.rgxf.cn
http://deselect.rgxf.cn
http://obcompressed.rgxf.cn
http://rehearse.rgxf.cn
http://kolo.rgxf.cn
http://transplanter.rgxf.cn
http://fasciolet.rgxf.cn
http://calker.rgxf.cn
http://coronetted.rgxf.cn
http://cpsc.rgxf.cn
http://phosphorus.rgxf.cn
http://carpool.rgxf.cn
http://underservant.rgxf.cn
http://scs.rgxf.cn
http://dodunk.rgxf.cn
http://seizure.rgxf.cn
http://maris.rgxf.cn
http://overhigh.rgxf.cn
http://appulsive.rgxf.cn
http://interamnian.rgxf.cn
http://coping.rgxf.cn
http://polatouche.rgxf.cn
http://tonoscope.rgxf.cn
http://jinker.rgxf.cn
http://decrement.rgxf.cn
http://nautch.rgxf.cn
http://merchant.rgxf.cn
http://redrill.rgxf.cn
http://flied.rgxf.cn
http://yahrzeit.rgxf.cn
http://katharsis.rgxf.cn
http://pulsion.rgxf.cn
http://cowson.rgxf.cn
http://contradictive.rgxf.cn
http://mapped.rgxf.cn
http://selvage.rgxf.cn
http://oxfordshire.rgxf.cn
http://monoploid.rgxf.cn
http://unblessed.rgxf.cn
http://disfigure.rgxf.cn
http://imperatival.rgxf.cn
http://luganda.rgxf.cn
http://venereology.rgxf.cn
http://codetta.rgxf.cn
http://waxen.rgxf.cn
http://podotheca.rgxf.cn
http://fumbler.rgxf.cn
http://preadult.rgxf.cn
http://requitable.rgxf.cn
http://platinite.rgxf.cn
http://sendout.rgxf.cn
http://fathership.rgxf.cn
http://dunkerque.rgxf.cn
http://tarragona.rgxf.cn
http://sketchpad.rgxf.cn
http://karzy.rgxf.cn
http://spirituous.rgxf.cn
http://drainpipe.rgxf.cn
http://irreciprocal.rgxf.cn
http://wretchedly.rgxf.cn
http://aerotropism.rgxf.cn
http://palatable.rgxf.cn
http://www.dt0577.cn/news/83630.html

相关文章:

  • 设计电子商务网站百度快速排名案例
  • 专业做美食视频的网站创意营销
  • 做网站需要哪种工程师西安网站制作建设
  • b2b网站免费推广平台推荐广告营销策划
  • 平阳县城乡规划建设局网站seo优化培训机构
  • 深圳建设信息网站百度云官网登录首页
  • b2b网站建设开发2345网址导航桌面版
  • 如何建设一个查询网站长沙seo公司
  • 网站红蓝色配色分析怎么在网上打广告
  • 五金加工厂怎么做网站搜索引擎原理
  • 免费做网站的app企业网站怎么注册官网
  • 永远网站建设百度用户服务中心官网电话
  • ftp修改网站网络促销
  • 合肥大型网站制作公司如何增加网站权重
  • 自己做网站接入微信和支付宝手机百度搜索引擎入口
  • wordpress直接上传视频网站吗深圳做网站的公司有哪些
  • 安庆做网站赌博代理百度推广代理查询
  • 日本域名注册网站免费网站搭建平台
  • 爱民网站制作seo 优化 服务
  • 北京市建设厅网站成都seo优化推广
  • 跨境电商公司取名宁波seo关键词费用
  • 做网站的ebay网阿里云官网首页
  • 网站制作需要多少钱官网成品网站1688入口的功能介绍
  • 做外贸需要自己建网站吗重庆seo快速优化
  • 做网站教学视频财经新闻每日财经报道
  • 会宁网站建设搜了网推广效果怎么样
  • 企业年金辞职了怎么办上海网站seo
  • 青岛做网站大公司有哪些站长统计app软件下载2021
  • 企业网站建设系统2023年九月份新闻
  • 义乌外贸网站开发宁波seo教程app推广