这篇文章主要介绍“PostgreSQL zedstore在CentOS 7.4进行大批量数据的测试分析”,在日常操作中,相信很多人在PostgreSQL zedstore在CentOS 7.4进行大批量数据的测试分析问题上存在疑惑,小编查阅了各式资料,整理出简单好用的操作方法,希望对大家解答”PostgreSQL zedstore在CentOS 7.4进行大批量数据的测试分析”的疑惑有所帮助!接下来,请跟着小编一起来学习吧!

zedstore在执行avg时直接coredump.

testdb=#createtablet_ap_heap(id1int,id2int,id3int,id4int,id5int,id6int,id7int,id8int,id9int);CREATETABLEtestdb=#testdb=#insertintot_ap_heaptestdb-#selectx,x,x,x,x,x,x,x,xtestdb-#fromgenerate_series(1,10000000)asx;INSERT010000000testdb=#testdb=#droptableifexistst_ap_zedstore;DROPTABLEtestdb=#createtablet_ap_zedstoretestdb-#(id1int,id2int,id3int,id4int,id5int,id6int,id7int,id8int,id9int)usingzedstore;CREATETABLEtestdb=#testdb=#insertintot_ap_zedstoretestdb-#selectx,x,x,x,x,x,x,x,xtestdb-#fromgenerate_series(1,10000000)asx;INSERT010000000testdb=#testdb=#selectpg_size_pretty(pg_table_size('t_ap_heap'));pg_size_pretty----------------651MB(1row)testdb=#selectpg_size_pretty(pg_table_size('t_ap_zedstore'));pg_size_pretty----------------501MB(1row)testdb=#explainanalyzeselectavg(id1)fromt_ap_heap;QUERYPLAN--------------------------------------------------------------------------------------------------------------------------------------------------FinalizeAggregate(cost=136417.97..136417.98rows=1width=32)(actualtime=2432.238..2432.240rows=1loops=1)->Gather(cost=136417.75..136417.96rows=2width=32)(actualtime=2432.015..2433.781rows=3loops=1)WorkersPlanned:2WorkersLaunched:2->PartialAggregate(cost=135417.75..135417.76rows=1width=32)(actualtime=2363.185..2363.185rows=1loops=3)->ParallelSeqScanont_ap_heap(cost=0.00..125001.00rows=4166700width=4)(actualtime=0.348..1843.592rows=3333333loops=3)PlanningTime:28.360msExecutionTime:2434.173ms(8rows)testdb=#explainanalyzeselectavg(id1)fromt_ap_zedstore;psql:WARNING:terminatingconnectionbecauseofcrashofanotherserverprocessDETAIL:Thepostmasterhascommandedthisserverprocesstorollbackthecurrenttransactionandexit,becauseanotherserverprocessexitedabnormallyandpossiblycorruptedsharedmemory.HINT:Inamomentyoushouldbeabletoreconnecttothedatabaseandrepeatyourcommand.psql:serverclosedtheconnectionunexpectedlyThisprobablymeanstheserverterminatedabnormallybeforeorwhileprocessingtherequest.Theconnectiontotheserverwaslost.Attemptingreset:Failed.!>

重新连接,执行查询:

testdb=#explainanalyzeselectavg(id1)fromt_ap_heap;QUERYPLAN-------------------------------------------------------------------------------------------------------------------------------------------------FinalizeAggregate(cost=136417.97..136417.98rows=1width=32)(actualtime=1357.266..1357.267rows=1loops=1)->Gather(cost=136417.75..136417.96rows=2width=32)(actualtime=1357.068..1362.153rows=3loops=1)WorkersPlanned:2WorkersLaunched:2->PartialAggregate(cost=135417.75..135417.76rows=1width=32)(actualtime=1346.515..1346.515rows=1loops=3)->ParallelSeqScanont_ap_heap(cost=0.00..125001.00rows=4166700width=4)(actualtime=0.488..830.427rows=3333333loops=3)PlanningTime:0.550msExecutionTime:1362.347ms(8rows)testdb=#explainanalyzeselectavg(id1)fromt_ap_zedstore;QUERYPLAN--------------------------------------------------------------------------------------------------------------------------------------------FinalizeAggregate(cost=107843.55..107843.56rows=1width=32)(actualtime=9.579..9.580rows=1loops=1)->Gather(cost=107843.33..107843.54rows=2width=32)(actualtime=0.467..11.620rows=3loops=1)WorkersPlanned:2WorkersLaunched:2->PartialAggregate(cost=106843.33..106843.34rows=1width=32)(actualtime=0.020..0.021rows=1loops=3)->ParallelSeqScanont_ap_zedstore(cost=0.00..98295.87rows=3418987width=4)(actualtime=0.007..0.008rows=0loops=3)PlanningTime:0.268msExecutionTime:11.835ms(8rows)testdb=#

heap vs zedstore : 1362ms vs 12ms,性能确实有大幅提升.

不过,等等

testdb=#selectavg(id1)fromt_ap_heap;avg----------------------5000000.500000000000(1row)testdb=#selectavg(id1)fromt_ap_zedstore;avg-----(1row)testdb=#selectcount(*)fromt_ap_zedstore;count-------0(1row)testdb=#insertintot_ap_zedstoretestdb-#selectx,x,x,x,x,x,x,x,xtestdb-#fromgenerate_series(1,10000000)asx;psql:ERROR:toomanyattributesforzedstoretestdb=#

到此,关于“PostgreSQL zedstore在CentOS 7.4进行大批量数据的测试分析”的学习就结束了,希望能够解决大家的疑惑。理论与实践的搭配能更好的帮助大家学习,快去试试吧!若想继续学习更多相关知识,请继续关注亿速云网站,小编会继续努力为大家带来更多实用的文章!