1. 背景
初步的测试一下openGauss与PostgreSQL数据库的全表扫描的的性能对比。
操作系统:Oracle Linux 7.8
机器环境:Dell R630,128GB内存,CPU情况如下:
Architecture: x86_64
CPU op-mode(s): 32-bit, 64-bit
Byte Order: Little Endian
CPU(s): 72
On-line CPU(s) list: 0-71
Thread(s) per core: 2
Core(s) per socket: 18
Socket(s): 2
NUMA node(s): 2
Vendor ID: GenuineIntel
CPU family: 6
Model: 79
Model name: Intel(R) Xeon(R) CPU E5-2686 v4 @ 2.30GHz
Stepping: 1
CPU MHz: 2839.654
CPU max MHz: 3000.0000
CPU min MHz: 1200.0000
BogoMIPS: 4600.06
Virtualization: VT-x
L1d cache: 32K
L1i cache: 32K
L2 cache: 256K
L3 cache: 46080K
NUMA node0 CPU(s): 0,2,4,6,8,10,12,14,16,18,20,22,24,26,28,30,32,34,36,38,40,42,44,46,48,50,52,54,56,58,60,62,64,66,68,70
NUMA node1 CPU(s): 1,3,5,7,9,11,13,15,17,19,21,23,25,27,29,31,33,35,37,39,41,43,45,47,49,51,53,55,57,59,61,63,65,67,69,71
Flags: fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon pebs bts rep_good nopl xtopology nonstop_tsc cpuid aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx smx est tm2 ssse3 sdbg fma cx16 xtpr pdcm pcid dca sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand lahf_lm abm 3dnowprefetch cpuid_fault epb cat_l3 cdp_l3 invpcid_single pti ssbd ibrs ibpb stibp tpr_shadow vnmi flexpriority ept vpid fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invpcid rtm cqm rdt_a rdseed adx smap intel_pt xsaveopt cqm_llc cqm_occup_llc cqm_mbm_total cqm_mbm_local dtherm ida arat pln pts md_clear flush_l1d
2. 测试场景
建测试表:
create table test01(id int, n int, t text);
生成测试数据:
insert into test01 select seq, seq / 100000, md5(seq::text) from generate_series(1, 1000000000) as seq;
总共生成了10亿条数据,表的大小为71GB。多次读表,让其数据都换成到内存中,不产生IO。
3. openGauss5.0的测试结果
如下图所示:

从上面可以看出扫描71G大小的10条记录的表花费了122秒。
4. PostgreSQL 13.6的测试结果

从上面可以看到时间为72秒。
另PostgreSQL支持并行查询,如果开启并行,就更块了:

5. 结论
PostgreSQL 13的全表扫描性能是openGauss的1.69倍。
点击关注乘数科技

文章转载自中启乘数,如果涉嫌侵权,请发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。




