介绍
这篇文章主要讲解了“相似图像搜索插件imgsmlr性能测试与优化方法是什么”,文中的讲解内容简单清晰,易于学习与理解,下面请大家跟着小编的思路慢慢深入,一起来研究和学习”相似图像搜索插件imgsmlr性能测试与优化方法是什么”吧!
citus(8节点,128碎片)
1,安装imgsmlr插件软件(所有节点)
2, <代码>创建扩展imgsmlr> 代码(所有节点)
3,生成随机img sig的函数(cn,因为只需要用于插入,不需要下推)
CREATE 或是REPLACE FUNCTION public.gen_rand_img_sig(整数),, ,RETURNS signature ,LANGUAGE sql ,STRICT 时间函数,美元AS select 才能;(& # 39;(& # 39;| |空白(ltrim(数组(select (随机()* 1美元)::float4 得到generate_series(16))::文本,& # 39;{& # 39;),& # 39;}& # 39;)| | & # 39;)& # 39;)::签名:,, 函数;美元
4,创建测试表(cn)
create table t_img (id int  primary 关键,,sig 签名),
5,创建索引(cn)
create index idx_t_img_1 提醒t_img using gist (sig);
6,创建分片表(128碎片)(cn)
set citus.shard_count =, 128,,, select create_distributed_table (& # 39; t_img& # 39; & # 39; id # 39;);
7,写入4.5亿随机图像特征值
vi test.sql , ,, \ set id 随机(1 2000000000),, insert into  t_img values (: id, gen_rand_img_sig(10)),提醒冲突(id), do ;
pgbench -M prepared -n -r -P 1, -f 。/test.sql -c 128年,-j 128年,-t 10000000
写入约4.5亿随机图像特征值
postgres=#, select count(*),得到t_img;,, ,,count ,,,, - - - - - - - - - - -女人,, ,446953185, (1,行)
postgres=#, select *,得到t_img limit 10;,, ,,,id ,,,, |,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, sig ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, - - - - - - - - - - - - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -,, 47902935,才能|,(5.861920,1.062770,8.318020,2.205840,0.202951,6.956610,1.413190,2.898480,8.961630,6.377800,1.110450,6.684520,2.286290,7.850760,1.832650,0.074348),, ,174656795 |,(2.165030,0.183753,9.913950,9.208260,5.165660,6.603510,2.008380,8.117910,2.358590,5.466330,9.139280,8.893700,4.664190,9.361670,9.016990,2.271000),, 96186891,才能|,(9.605980,4.395920,4.336720,3.174360,8.706960,0.155107,9.408940,4.531100,2.783530,5.681780,9.792380,6.428320,2.983760,9.733290,7.635160,7.035780),, 55061667,才能|,(7.567960,5.874530,5.222040,5.638520,3.488960,8.770750,7.054610,7.239630,9.202280,9.465020,4.079080,5.729770,0.475227,8.434800,6.873730,5.140080),, 64659434,才能|,(4.860650,3.984440,3.009900,5.116680,6.489150,4.224800,0.609752,8.731120,6.577390,8.542540,9.096120,8.976700,8.936000,2.836270,7.186250,6.264300),, 87143098,才能|,(4.801570,7.870150,0.939599,3.666670,1.102340,5.819580,6.511330,6.430760,0.584531,3.024190,6.255460,8.823820,5.076960,0.181344,8.137380,1.230360),, null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null null相似图像搜索插件imgsmlr性能测试与优化方法是什么