地震前兆Oracle LOB数据压缩与交换及其访问效率研究*

(1.甘肃省地震局,甘肃 兰州 730000; 2.安丘地震台,山东 潍坊 262100; 3.中国地震台网中心,北京 100045)

Oracle; LOB; 数据压缩; 交换效率; 访问效率

Research on Compression,Exchange and Access Efficiency of Seismic Precursor Oracle LOB data
WANG Jianjun1,ZHAO Yingang2,LIU Gaochuan3

(1.Gansu Earthquake Agnecy,Lanzhou 73000,Gansu,China)(2.Anqiu Earthquake Station,Weifang 262100,Shandong,China)(3.China Earthquake Networks Center,Beijing 100045,China)

备注

针对目前地震前兆Oracle数据库存在的存储空间大、交换速度慢、读写速度慢等问题,分别用Bzip2,Gzip,GzipIO这3种压缩算法对Clob和Blob的压缩和未压缩数据进行读写和交换速度测试,使用直接读取、分段读取、分段+线程池读取3种方法进行了读库速度测试。结果 表明:①无论在存储、交换还是读写速度方面Blob均优于Clob; ②Blob+Gzip为地震前兆分秒数据的“最佳”存储结构,读写和交换速度有大幅度提升,数据库整体容量降至目前的7%(或更少),秒数据的交换速率至少是目前的7.89倍; ③最简单且被软件开发者广泛使用的直接读取方法读库效率较差,分段+线程池技术无论在Clob还是Blob、压缩还是未压缩时都表现出较高的读库效率,给LOB数据读取速度带来飞跃式的提升。

Aiming at the problems of huge storage space,low exchange speed and low read-write speed of the current seismic precursor Oracle database,the read-write speed and exchange speed tests are performed on the compressed and uncompressed Clob and Blob data by three compression algorithms,including Bzip2,Gzip and GzipIO.The reading speed test is performed by the direct reading,substr reading,and substr+threadPool reading techniques.The results show that:①Blob is superior to Clob in terms of storage,exchange,or read-write speed; ②For the seismic precursor database,Blob+Gzip is the optimal storage structure of the minute and second data.The read-write speed is greatly improved,and the overall capacity of the database is reduced to 7%(or less).The exchange rate of the second data is at least 7.89 times of the present rate; ③The simplest and most widely used direct reading method by software developers has poor database read efficiency,while the substr+threadPool technique shows higher database reading efficiency no matter for Clob or Blob,for compressed or uncompressed,which brings a leap-forward improvement in the read speed of LOB data.