1、PostgreSQL 5G 5G 20185G 20195G 20205G 5NS/ NFNDG/V55p 5G2SANSAp NSALTE 5G LTE5G5G2G3G4G 5Gu 2/3/4/5Gu AIu 5GPSPG Clusters & ApplicaionsApplicationsapp appappappApplicationsappappappappappappappapp45.IPOD PODPG Cluster 1POD POD PODPOD POD PODPG Cluster 2PG Cluster 323 PG R1M 1M Q UMEOESXXXPGsPPPGPPGP
2、GP PGDocker OGPODPOD PPODNodePGPG1nGDGPKGllDKPC4PKO8SPDRservicePOD2 PG ProxyPOD1 POD3 POD4 PG ServerPG ProxyPG ProxyPG ServerPacemakerPG ProxyPOD4 PacemakerPG ServerPG ServerPOD4 PG ProxyPG ProxyPG ServerPacemakerPacemakerPacemakerPOD1 PG ProxyPG ServerPOD2 PG ProxyPOD1 PG ProxyPOD1 PacemakerPG Serv
3、erPG ProxyPG ServerPacemakerPacemakerPG ServerPG ServerPacemakerPacemakerNode 1 L1Node 2 L1Node 3 L1 nodeAffinityPODNode podAffinityPODPOD podAntiAffinityPODPODKubernetesPOD1 POD1 POD1 POD1 PG ProxyPGPOD1 ErrorPGErrorOKPG ProxyPG ServerPacemakerPG eP SPacemakerPacemak rPacemakerData AData BNode 1Dat
4、a CNode 4Node 2Node 3IOCPUI0p D7%CcPGPrPcePGeo2oO%POkp 0k7%Cc%PODUMasterSlaveSlavesPuelmG_5u Ac W WAMsriL W_aAL WaAL WaAu urLcypWhAnR/W AppWrite AppRead Appu auLcypWmtovPG Proxysyncsyncu yplmsSlaveMasterSlaveSwrite/readread42QJ Su QJoNGLLJ XhdCBCRt1d,0/a vXL S051R0RU%USELECTvalueFROMt1 WHERE(value-a
5、IN(1,2)ANDvalue-v=1AND(value-mISNULLORvalue-m-valueIN(0)ANDvalue-pIN(1,2,3,4)ORDERBYvalue-sDESC,value-idDESCLIMIT 10OFFSET40;u LLQB53SRXOS,0/RuRcgPQY,0/PRYYGQRRYGY15RR15oOu O1SPQCFBnSM,0/RRYRs1 XRvXORNRY,0/YXvOS,0/,0/1euRl/C2-DCGBERrbOmaCBCOSfRXODIrG IJPHVehHnRLunQu TasEaseRSBWIlQHLHHcHLHUHLtu -iMhL
6、hLGHasSELECTto_jsonb(_t_)AS valueFROM(SELECTvalue-pASp,value-aASa,COUNT(value)AScountFROMt1 WHERE(value-v =1)GROUPBY value-p,value-a ORDERBY value-pDESC)_t_;IBexplainpGROUP BY173383 GroupAggregateu MQNQPMtrH1-34Ls4GOHiO OHpYNLg4iHpDi4xHA4HrpGROUP BY3 Hi44IJpSxHaHSubqueryScanon_t_ (cost=274591.10.281
7、092.97rows=173383width=32)(actualtime=15004.376.17488.863rows=4loops=1)Output:to_jsonb(_t_.*)Buffers:sharedhit=34395,tempread=30752written=30764- GroupAggregate (cost=274591.10.278925.68rows=173383 width=72)(actualtime=15004.299.17488.691rows=4 loops=1)SubqueryScanon_t_ (cost=39162.99.39163.04rows=3
8、width=32)(actualtime=5314.232.5314.244rows=4loops=1)Output:to_jsonb(_t_.*)Buffers:sharedhit=34395- Sort (cost=39162.99.39163.00rows=3width=72)(actualtime=5314.187.5314.188rows=4loops=1)Output:.Output:.GroupKey:.SortKey:.SortMethod:quicksort Memory:25kBBuffers:sharedhit=34395- HashAggregate (cost=391
9、62.92.39162.97 rows=3 width=72)(actualtime=5314.167.5314.169rows=4 loops=1)Output:.Buffers:sharedhit=34395,tempread=30752written=30764- Sort (cost=274591.10.275024.56rows=173383 width=1467)(actualtime=15004.264.16796.003rows=173379loops=1)Output:.SortKey:.GroupKey:.Buffers:sharedhit=34395- SeqScanon
10、.SortMethod:externalmerge Disk:246016kBBuffers:sharedhit=34395,tempread=30752written=30764- SeqScanon.Output:.Filter:.Output:.Filter:.Buffers:sharedhit=34395Planningtime:2.098msExecutiontime:17800.406 ms(18rows)Buffers:sharedhit=34395Planningtime:0.515msExecutiontime: 5314.341 ms(18rows)ij2 RRPK MRc
11、m TcmrPObvPneObPne TbRbTbyj ibiRR btbou 0u 0+bsaPrimaryStandbyasync streamingMasterMasterD1D1SlaveSeSlaveD2D3D2D2 mPD12 12nbP12-.3nbSy12G23nbSmasdiP MtB12e-.3nbAarnbSmaedyDvnPrimaryStandbyreplayMasterMasterget WAL filesWALWALfil GD1D1ASlaveSeSlaveD2D3D2D2_ hDRM113T1.T W3ToivnS23131BcTOrtbLPa11usm _OrmSrsMdlePrimaryStandbyStandbyreplaysync streamingMasterRelayMasterWALD1D1SlaveSlaveSlaveSlaveD2D3D2D2 LnaWSrsMR+.3+.331+3 .+.3aSrsMy.+AnasMtBMinGSrsMPbrsM +.3+2D.+dle