沉浸式学习PostgreSQL|PolarDB 4: 跨境电商场景, 快速判断商标|品牌侵权

本文涉及的产品
云原生数据库 PolarDB MySQL 版,Serverless 5000PCU 100GB
简介: 很多业务场景中需要判断商标侵权, 避免纠纷. 例如电商的商品文字描述、图片描述中可能有侵权内容. 特别是跨境电商, 在一些国家侵权查处非常严厉.注册公司名、产品名时可能侵权.在写文章时, 文章的文字内容、视频内容、图片内容中的描述可能侵权.例如postgresql是个商标, 如果你使用posthellogresql、postgresqlabc也可能算侵权.以跨境电商为力, 为了避免侵权, 在发布内容时需要商品描述中出现的品牌名、产品名等是否与已有的商标库有相似.对于跨境电商场景, 由于店铺和用户众多, 商品的修改、发布是比较高频的操作, 所以需要实现高性能的字符串相似匹配功能.

作者

digoal

日期

2023-08-25

标签

PostgreSQL , PolarDB , 数据库 , 教学


背景

非常欢迎数据库用户提出场景给我, 在此issue回复即可, 一起来建设沉浸式数据库学习教学素材库, 帮助开发者用好数据库, 提升开发者职业竞争力, 同时为企业降本提效.

  • 这个系列课程的核心是教怎么用好数据库, 而不是怎么管理数据库或者怎么开发数据库内核. 所以面向的对象是数据库的用户、应用开发者、应用架构师、数据库厂商的产品经理、售前售后专家等角色.

本文的实验可以使用永久免费的阿里云云起实验室来完成.

如果你本地有docker环境也可以把镜像拉到本地来做实验:

x86_64机器使用以下docker image:

ARM机器使用以下docker image:

业务场景1 介绍: 跨境电商场景, 快速判断商标|品牌侵权

很多业务场景中需要判断商标侵权, 避免纠纷. 例如

  • 电商的商品文字描述、图片描述中可能有侵权内容. 特别是跨境电商, 在一些国家侵权查处非常严厉.
  • 注册公司名、产品名时可能侵权.
  • 在写文章时, 文章的文字内容、视频内容、图片内容中的描述可能侵权.

而且商标侵权通常还有相似的情况, 避免不法分子蹭大品牌的流量, 导致大品牌名誉受损.

例如postgresql是个商标, 如果你使用posthellogresql、postgresqlabc也可能算侵权.

以跨境电商为力, 为了避免侵权, 在发布内容时需要商品描述中出现的品牌名、产品名等是否与已有的商标库有相似.

对于跨境电商场景, 由于店铺和用户众多, 商品的修改、发布是比较高频的操作, 所以需要实现高性能的字符串相似匹配功能.

实现和对照

创建一张品牌表, 用于存储收集好的注册商标(通常最终转换为文字).

create unlogged table tbl_ip (   -- 测试使用unlogged table, 加速数据生成  
  id serial primary key,  -- 每一条品牌信息的唯一ID  
  n text  -- 品牌名  
);

使用随机字符模拟生成1000万条品牌名.

insert into tbl_ip (n) select md5(random()::text) from generate_series(1,10000000);

再放入几条比较容易识别的:

insert into tbl_ip(n) values ('polardb'),('polardbpg'),('polardbx'),('alibaba'),('postgresql'),('mysql'),('aliyun'),('apsaradb'),('apple'),('microsoft');
postgres=# select * from tbl_ip limit 10;  
 id |                n                   
----+----------------------------------  
  1 | f4cd4669d249c1747c1d31b0b492d84e  
  2 | 2e29f32460485698088f4ab0632d86b7  
  3 | a8460622db4a3dc4ab70a8443a2c2a1a  
  4 | c4554856e259d3dfcccfb3c9872ab1d0  
  5 | b3a6041c5838d70d95a1316eea45bea3  
  6 | fc2d701eca05c74905fd1a604f072006  
  7 | f3dc443060e33bb672dc6a3b79bc1acd  
  8 | 1305b6092f9e798453e9f60840b8db2a  
  9 | 9b07cad251661627e15f239e5b122eaf  
 10 | 8b5d2a468435febe417b17d0d0442b86  
(10 rows)  
postgres=# select count(*) from tbl_ip;  
  count     
----------  
 10000010  
(1 row)

传统方法 设计和实验

传统方法只能使用like全模糊查询, 但是局部侵权的可能性非常多, 使用模糊查询需要很多很多组合, 性能会非常差.

例如postgresql是个商标, 如果用户使用了一个字符串为以下组合, 都可能算侵权:

  • post
  • postgres
  • sql
  • gresql
  • postgresql
  • postgre

写成SQL应该是这样的

select * from tbl_ip where  
  n like '%post%' or  
  n like '%postgres%' or  
  n like '%sql%' or  
  n like '%gresql%' or  
  n like '%postgresql%' or  
  n like '%postgre%';

结果

id    |     n        
----------+------------  
 10000005 | postgresql  
 10000006 | mysql  
(2 rows)

耗时如下

QUERY PLAN                                                                                    
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  
 Seq Scan on tbl_ip  (cost=0.00..333336.00 rows=5999 width=37) (actual time=2622.461..2622.463 rows=2 loops=1)  
   Filter: ((n ~~ '%post%'::text) OR (n ~~ '%postgres%'::text) OR (n ~~ '%sql%'::text) OR (n ~~ '%gresql%'::text) OR (n ~~ '%postgresql%'::text) OR (n ~~ '%postgre%'::text))  
   Rows Removed by Filter: 10000008  
 Planning Time: 1.381 ms  
 JIT:  
   Functions: 2  
   Options: Inlining false, Optimization false, Expressions true, Deforming true  
   Timing: Generation 1.442 ms, Inlining 0.000 ms, Optimization 1.561 ms, Emission 6.486 ms, Total 9.489 ms  
 Execution Time: 2624.001 ms  
(9 rows)

PolarDB|PG新方法1 设计和实验

使用pg_trgm插件, gin索引, 以及它的字符串相似查询功能,

创建插件

postgres=# create extension if not exists pg_trgm;  
NOTICE:  extension "pg_trgm" already exists, skipping  
CREATE EXTENSION

创建索引

postgres=# create index on tbl_ip using gin (n gin_trgm_ops);

设置相似度阈值, 仅返回相似度大于0.9的记录

postgres=# set pg_trgm.similarity_threshold=0.9;  
SET

使用相似度查询

select *,   
  similarity(n, 'post'),  
  similarity(n, 'postgres'),  
  similarity(n, 'sql'),  
  similarity(n, 'gresql'),  
  similarity(n, 'postgresql'),  
  similarity(n, 'postgre')  
from tbl_ip   
where  
  n % 'post' or  
  n % 'postgres' or  
  n % 'sql' or  
  n % 'gresql' or  
  n % 'postgresql' or  
  n % 'postgre';

结果

id    |     n      | similarity | similarity | similarity | similarity | similarity | similarity   
----------+------------+------------+------------+------------+------------+------------+------------  
 10000005 | postgresql | 0.33333334 |  0.6666667 | 0.15384616 |  0.3846154 |          1 |  0.5833333  
(1 row)

耗时如下

QUERY PLAN                                                                              
------------------------------------------------------------------------------------------------------------------------------------------------------------------  
 Bitmap Heap Scan on tbl_ip  (cost=996.70..7365.20 rows=5999 width=37) (actual time=0.180..0.183 rows=1 loops=1)  
   Recheck Cond: ((n % 'post'::text) OR (n % 'postgres'::text) OR (n % 'sql'::text) OR (n % 'gresql'::text) OR (n % 'postgresql'::text) OR (n % 'postgre'::text))  
   Heap Blocks: exact=1  
   ->  BitmapOr  (cost=996.70..996.70 rows=6000 width=0) (actual time=0.140..0.141 rows=0 loops=1)  
         ->  Bitmap Index Scan on tbl_ip_n_idx  (cost=0.00..115.30 rows=1000 width=0) (actual time=0.053..0.053 rows=0 loops=1)  
               Index Cond: (n % 'post'::text)  
         ->  Bitmap Index Scan on tbl_ip_n_idx  (cost=0.00..200.00 rows=1000 width=0) (actual time=0.019..0.019 rows=0 loops=1)  
               Index Cond: (n % 'postgres'::text)  
         ->  Bitmap Index Scan on tbl_ip_n_idx  (cost=0.00..93.30 rows=1000 width=0) (actual time=0.007..0.007 rows=0 loops=1)  
               Index Cond: (n % 'sql'::text)  
         ->  Bitmap Index Scan on tbl_ip_n_idx  (cost=0.00..157.10 rows=1000 width=0) (actual time=0.011..0.011 rows=0 loops=1)  
               Index Cond: (n % 'gresql'::text)  
         ->  Bitmap Index Scan on tbl_ip_n_idx  (cost=0.00..242.90 rows=1000 width=0) (actual time=0.035..0.035 rows=1 loops=1)  
               Index Cond: (n % 'postgresql'::text)  
         ->  Bitmap Index Scan on tbl_ip_n_idx  (cost=0.00..179.10 rows=1000 width=0) (actual time=0.013..0.013 rows=0 loops=1)  
               Index Cond: (n % 'postgre'::text)  
 Planning Time: 4.682 ms  
 Execution Time: 0.272 ms  
(18 rows)

使用了pg_trgm后, 即使是like查询响应速度也飞快:

postgres=# explain analyze select * from tbl_ip where  
  n like '%post%' or  
  n like '%postgres%' or  
  n like '%sql%' or  
  n like '%gresql%' or  
  n like '%postgresql%' or  
  n like '%postgre%';  
                                                                                     QUERY PLAN                                                                                       
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------  
 Bitmap Heap Scan on tbl_ip  (cost=612.80..6981.30 rows=5999 width=37) (actual time=0.122..0.126 rows=2 loops=1)  
   Recheck Cond: ((n ~~ '%post%'::text) OR (n ~~ '%postgres%'::text) OR (n ~~ '%sql%'::text) OR (n ~~ '%gresql%'::text) OR (n ~~ '%postgresql%'::text) OR (n ~~ '%postgre%'::text))  
   Heap Blocks: exact=1  
   ->  BitmapOr  (cost=612.80..612.80 rows=6000 width=0) (actual time=0.099..0.101 rows=0 loops=1)  
         ->  Bitmap Index Scan on tbl_ip_n_idx  (cost=0.00..50.40 rows=1000 width=0) (actual time=0.047..0.048 rows=1 loops=1)  
               Index Cond: (n ~~ '%post%'::text)  
         ->  Bitmap Index Scan on tbl_ip_n_idx  (cost=0.00..136.20 rows=1000 width=0) (actual time=0.011..0.011 rows=1 loops=1)  
               Index Cond: (n ~~ '%postgres%'::text)  
         ->  Bitmap Index Scan on tbl_ip_n_idx  (cost=0.00..29.50 rows=1000 width=0) (actual time=0.003..0.003 rows=2 loops=1)  
               Index Cond: (n ~~ '%sql%'::text)  
         ->  Bitmap Index Scan on tbl_ip_n_idx  (cost=0.00..93.30 rows=1000 width=0) (actual time=0.014..0.014 rows=1 loops=1)  
               Index Cond: (n ~~ '%gresql%'::text)  
         ->  Bitmap Index Scan on tbl_ip_n_idx  (cost=0.00..179.10 rows=1000 width=0) (actual time=0.014..0.014 rows=1 loops=1)  
               Index Cond: (n ~~ '%postgresql%'::text)  
         ->  Bitmap Index Scan on tbl_ip_n_idx  (cost=0.00..115.30 rows=1000 width=0) (actual time=0.008..0.008 rows=1 loops=1)  
               Index Cond: (n ~~ '%postgre%'::text)  
 Planning Time: 0.571 ms  
 Execution Time: 0.207 ms  
(18 rows)

对照

品牌数 传统like查询耗时 ms pg_trgm近似查询耗时 ms pg_trgm like查询耗时 ms
1000万条 2624.001 0.272 0.207

知识点

1、pg_trgm

https://www.postgresql.org/docs/16/pgtrgm.html

如何计算两个字符串的相似度:

  • 1、切词. 非字母或数字都被认为是word分隔符, 将字符串拆分成若干个word.
  • 2、将word转换成token. 在每个word的前面加2个空格, 每个word的末尾加1个空格, 然后以连续的三个字符为一组, 从头开始切, 将每个" word "切分为若干个“3个字符的token”.
  • 3、去除重复token, 得到一组token.
  • 4、根据token来计算2个字符串的相似性. 注意有不同的算法.

将字符串转换生成token的例子:

-- 第一步得到two和words, 然后得到"  two "和"  words ", 然后得到以下.   
postgres=# select show_trgm('two ,words');    
                       show_trgm                         
-------------------------------------------------------  
 {"  t","  w"," tw"," wo","ds ",ord,rds,two,"wo ",wor}  
(1 row)  
postgres=# select show_trgm('two , words');  
                       show_trgm                         
-------------------------------------------------------  
 {"  t","  w"," tw"," wo","ds ",ord,rds,two,"wo ",wor}  
(1 row)  
postgres=# select show_trgm(' two , words   ');  
                       show_trgm                         
-------------------------------------------------------  
 {"  t","  w"," tw"," wo","ds ",ord,rds,two,"wo ",wor}  
(1 row)  
-- 结果token会去重    
postgres=# select show_trgm('two two1');     
             show_trgm               
-----------------------------------  
 {"  t"," tw","o1 ",two,"wo ",wo1}  
(1 row)  
postgres=# select show_trgm('two');  
        show_trgm          
-------------------------  
 {"  t"," tw",two,"wo "}  
(1 row)  
postgres=# select show_trgm('words');  
            show_trgm              
---------------------------------  
 {"  w"," wo","ds ",ord,rds,wor}  
(1 row)  
postgres=# select show_trgm('abc');  
        show_trgm          
-------------------------  
 {"  a"," ab",abc,"bc "}  
(1 row)  
postgres=# select show_trgm('abc hello');  
                       show_trgm                         
-------------------------------------------------------  
 {"  a","  h"," ab"," he",abc,"bc ",ell,hel,llo,"lo "}  
(1 row)

比较两个字符串相似性的算法: 详见 contrib/pg_trgm/trgm_op.c

1: similarity (%) (t % 'word'  ==> 计算相似性对应  similarity(t, 'word'))

相似性 = 两个字符串的token交集去重后的个数 / 两个字符串的token并集去重后的个数

大致可以表达 两个字符串的整体相似性.

阈值参数: pg_trgm.similarity_threshold (real)

2: word_similarity (<% and %>) ('word' <% t  ==> 计算相似性对应  word_similarity('word', t))

word_similarity(string1, string2) == count.匹配string1 token的(token(substring(string2中的任意连续的word组))) / count(token(string1))

大致可以表达 字符串2的若干连续字符与字符串1的相似度.

阈值参数: pg_trgm.word_similarity_threshold (real)

3: strict_word_similarity (<<% and %>>) ('word' <<% t  ==> 计算相似性对应  strict_word_similarity('word', t))

strict_word_similarity(string1, string2) == max( similarity(string1, string2中的任意连续的word组) )

大致可以表达 字符串2的若干连续单词与字符串1的相似度.

相似度阈值参数, 相似度大于阈值时, 对应的相似操作符返回true的结果.

阈值参数: pg_trgm.strict_word_similarity_threshold (real)

计算两个字符串相似度的例子:

postgres=# select similarity('abc','abc hello');  
 similarity   
------------  
        0.4  
(1 row)  
postgres=# select similarity('abc hello','abc');  
 similarity   
------------  
        0.4  
(1 row)  
word_similarity  
postgres=# select word_similarity('abc','abc hello');  
 word_similarity   
-----------------  
               1  
(1 row)  
postgres=# select word_similarity('abc hello','abc');  
 word_similarity   
-----------------  
             0.4  
(1 row)  
strict_word_similarity  
postgres=# select strict_word_similarity('abc','abc hello');  
 strict_word_similarity   
------------------------  
                      1  
(1 row)  
postgres=# select strict_word_similarity('abc hello','abc');  
 strict_word_similarity   
------------------------  
                    0.4  
(1 row)  
postgres=# select similarity('word', 'wor ord');  
 similarity   
------------  
      0.625  
(1 row)  
postgres=# select similarity('word', 'ord wor');  
 similarity   
------------  
      0.625  
(1 row)  
postgres=# select word_similarity('word', 'ord wor');  
 word_similarity   
-----------------  
               1  
(1 row)  
postgres=# select word_similarity('word', 'wor ord');  
 word_similarity   
-----------------  
           0.625  
(1 row)  
postgres=# select strict_word_similarity('word', 'wor ord');  
 strict_word_similarity   
------------------------  
                  0.625  
(1 row)  
postgres=# select strict_word_similarity('word', 'ord wor');  
 strict_word_similarity   
------------------------  
                  0.625  
(1 row)

思考

为什么传统方法与pg_trgm相比性能相差这么大?

字符串近似查询还可以应用于哪些场景?

如果将相似度调低, 性能还能这么好吗?

如果想返回最相似的一条, 怎么优化查询效果最佳?

和smlar相比, 搜索算法是否有相似之处?

参考

202308/20230824_02.md 《沉浸式学习PostgreSQL|PolarDB 3: 营销场景, 根据用户画像的相似度进行目标人群圈选, 实现精准营销》
202308/20230807_01.md 《又一款PostgreSQL 向量索引插件 pgvecto.rs , 支持ivfflat, hnsw. 助力非结构化数据的特征向量相似搜索》
202304/20230419_02.md 《rust pub use 和 PostgreSQL WITH GRANT OPTION 设计相似之处》
202303/20230331_07.md 《ChatGPT背后的数据库技术体验 - 向量近似搜索之 milvus(专业的向量数据库)》
202303/20230330_03.md 《ChatGPT背后的数据库技术体验 - 向量近似搜索之 lance》
202303/20230330_01.md 《ChatGPT背后的数据库技术体验 - 向量近似搜索之 PostgreSQL+pase(hnsw,ivfflat,ivfpq)》
202212/20221223_01.md 《使用 PolarDB 开源版 smlar 插件进行高效率相似文本搜索、自助选药、相似人群圈选等业务》
202212/20221222_04.md 《使用 PolarDB 开源版 和 imgsmlr 存储图像特征值以及快速的进行图像相似搜索》
202212/20221221_02.md 《PolarDB 开源版通过 pg_trgm GIN 索引实现高效率 like '%xxx%' 模糊查询》
202212/20221217_01.md 《PolarDB 开源版通过 parray_gin 实现高效率 数组、JSON 内元素的模糊搜索》
202212/20221209_01.md 《PolarDB 开源版通过pg_similarity实现17种文本相似搜索 - token归一切分, 根据文本相似度检索相似文本.》
202212/20221201_02.md 《ChatGPT背后的数据库技术体验 - 向量近似搜索之 pgvector : 如何用 PolarDB 在不确定世界寻找确定答案 (例如图像相似) - pgvector|pase》
202208/20220829_02.md 《DuckDB 字符串相似性计算函数》
202203/20220323_02.md 《JSON 局部相似 搜索例子》
202203/20220302_01.md 《PostgreSQL + FDW + vector 插件加速向量检索 - 在不确定世界寻找确定答案 (例如图像相似)》
202110/20211005_01.md 《PostgreSQL 数组或JSON内容的模糊匹配索引插件: parray_gin》
202106/20210607_01.md 《重新发现PostgreSQL之美 - 16 like '%西出函谷关%' 模糊查询》
202105/20210518_01.md 《近似查询处理(Approximate Query Processing) - DataSketches - 压缩、distinct、分位、rank、高频柱状图(count distinct, quantiles, most-frequent items, joins, matrix computations, and graph analysis) 等 实时 大数据 近似分析》
202105/20210514_03.md 《PostgreSQL 开源 高维向量相似搜索插件 vector - 关联阿里云rds pg pase, cube, 人脸识别》
202105/20210510_01.md 《PostgreSQL 应用开发解决方案最佳实践系列课程 - 7. 标签搜索和圈选、相似搜索和圈选、任意字段组合搜索和圈选系统》
202105/20210506_01.md 《PostgreSQL 应用开发解决方案最佳实践系列课程 - 3. 人脸识别和向量相似搜索》
202105/20210502_01.md 《PostgreSQL 应用开发解决方案最佳实践系列课程 - 1. 中文分词与模糊查询》
202101/20210103_01.md 《PostgreSQL 文本相似搜索 - pg_trgm_pro - 包含则1, 不包含则计算token相似百分比》
202010/20201011_02.md 《PostgreSQL HLL 近似计算算法要点》
202009/20200930_01.md 《PostgreSQL 在资源搜索中的设计 - pase, smlar, pg_trgm - 标签+权重相似排序 - 标签的命中率排序》
202009/20200913_01.md 《[直播]在数据库中跑全文检索、模糊查询SQL会不会被开除?》
202009/20200912_01.md 《PostgreSQL 模糊查询、相似查询 (like '%xxx%') pg_bigm 比 pg_trgm 优势在哪?》
202004/20200424_01.md 《PostgreSQL 向量相似推荐设计 - pase》
202004/20200421_01.md 《社交、电商、游戏等 推荐系统 (相似推荐) - 阿里云pase smlar索引方案对比》
202003/20200330_01.md 《PostgreSQL 模糊查询增强插件pgroonga , pgbigm (含单字、双字、多字、多字节字符) - 支持JSON模糊查询等》
202003/20200326_08.md 《PostgreSQL ghtree实现的海明距离排序索引, 性能不错(模糊图像) - pg-knn_hamming - bit string 比特字符串 相似度搜索》
202003/20200326_02.md 《PostgreSQL VagueGeometry vague spatial data - VASA (Vague Spatial Algebra) for PG - 模糊空间数据》
202003/20200324_37.md 《PostgreSQL 近似算法库 - DataSketches》
202003/20200324_29.md 《PostgreSQL bktree 索引using gist例子 - 海明距离检索 - 短文相似、模糊图像搜索 - bit string 比特字符串 相似度搜索》
202002/20200228_02.md 《用户喜好推荐系统 - PostgreSQL 近似计算应用》
202002/20200227_01.md 《阿里云PostgreSQL案例精选2 - 图像识别、人脸识别、相似特征检索、相似人群圈选》
202001/20200116_01.md 《PostgreSQL+MySQL 联合解决方案 - 第12课视频 - 全文检索、中文分词、模糊查询、相似文本查询》
202001/20200115_01.md 《PostgreSQL+MySQL 联合解决方案 - 第11课视频 - 多维向量相似搜索 - 图像识别、相似人群圈选等》
202001/20200113_01.md 《PostgreSQL+MySQL 联合解决方案 - 第9课视频 - 实时精准营销(精准圈选、相似扩选、用户画像)》
201911/20191128_02.md 《画像系统标准化设计 - PostgreSQL roaringbitmap, varbitx , 正向关系, 反向关系, 圈选, 相似扩选(向量相似扩选)》
201908/20190815_01.md 《阿里云PostgreSQL 向量搜索、相似搜索、图像搜索 插件 palaemon - ivfflat , hnsw , nsg , ssg》
201903/20190320_01.md 《PostgreSQL 数组里面的元素,模糊搜索,模糊查询,like,前后百分号,正则查询,倒排索引》
201811/20181129_01.md 《PostgreSQL 多维、图像 欧式距离、向量距离、向量相似 查询优化 - cube,imgsmlr - 压缩、分段、异步并行》
201810/20181011_01.md 《PostgreSQL 相似人群圈选,人群扩选,向量相似 使用实践 - cube》
201809/20180904_04.md 《PostgreSQL 11 相似图像搜索插件 imgsmlr 性能测试与优化 3 - citus 8机128shard (4亿图像)》
201809/20180904_03.md 《PostgreSQL 11 相似图像搜索插件 imgsmlr 性能测试与优化 2 - 单机分区表 (dblink 异步调用并行) (4亿图像)》
201809/20180904_02.md 《PostgreSQL 11 相似图像搜索插件 imgsmlr 性能测试与优化 1 - 单机单表 (4亿图像)》
201809/20180904_01.md 《PostgreSQL 相似搜索插件介绍大汇总 (cube,rum,pg_trgm,smlar,imgsmlr,pg_similarity) (rum,gin,gist)》
201806/20180612_01.md 《PostgreSQL 一复合查询SQL优化例子 - (多个exists , 范围检索 , IN检索 , 模糊检索 组合)》
201806/20180607_02.md 《Greenplum 轨迹相似(伴随分析)》
201805/20180502_01.md 《PostgreSQL 模糊查询+大量重复值匹配 实践 - 分区索引 = any (array())》
201803/20180329_01.md 《PostgreSQL 相似文本检索与去重 - (银屑病怎么治?银屑病怎么治疗?银屑病怎么治疗好?银屑病怎么能治疗好?)》
201803/20180316_05.md 《[未完待续] PostgreSQL NP完全问题求近似解 例子, 最低成本集合》
201802/20180205_03.md 《PostgreSQL 相似搜索分布式架构设计与实践 - dblink异步调用与多机并行(远程 游标+记录 UDF实例)》
201802/20180202_01.md 《PostgreSQL 相似搜索设计与性能 - 地址、QA、POI等文本 毫秒级相似搜索实践》
201801/20180118_03.md 《PostgreSQL 模糊查询 与 正则匹配 性能差异与SQL优化建议》
201712/20171227_01.md 《PostgreSQL 遗传学应用 - 矩阵相似距离计算 (欧式距离,...XX距离)》
201712/20171205_02.md 《用PostgreSQL 做实时高效 搜索引擎 - 全文检索、模糊查询、正则查询、相似查询、ADHOC查询》
201711/20171107_18.md 《HTAP数据库 PostgreSQL 场景与性能测试之 17 - (OLTP) 数组相似查询》
201711/20171107_17.md 《HTAP数据库 PostgreSQL 场景与性能测试之 16 - (OLTP) 文本特征向量 - 相似特征(海明...)查询》
201711/20171107_14.md 《HTAP数据库 PostgreSQL 场景与性能测试之 13 - (OLTP) 字符串搜索 - 相似查询》
201711/20171107_13.md 《HTAP数据库 PostgreSQL 场景与性能测试之 12 - (OLTP) 字符串搜索 - 前后模糊查询》
201711/20171107_10.md 《HTAP数据库 PostgreSQL 场景与性能测试之 9 - (OLTP) 字符串模糊查询 - 含索引实时写入》
201710/20171020_01.md 《多国语言字符串的加密、全文检索、模糊查询的支持》
201710/20171016_04.md 《Greenplum 模糊查询 实践》
201708/20170804_01.md 《海量数据,海明(simhash)距离高效检索(smlar) - 阿里云RDS PosgreSQL最佳实践 - bit string 比特字符串 相似度搜索》
201705/20170524_01.md 《17种文本相似算法与GIN索引 - pg_similarity》
201704/20170426_01.md 《PostgreSQL 模糊查询最佳实践 - (含单字、双字、多字模糊查询方法)》
201701/20170116_04.md 《PostgreSQL结合余弦、线性相关算法 在文本、图片、数组相似 等领域的应用 - 3 rum, smlar应用场景分析》
201701/20170116_03.md 《PostgreSQL结合余弦、线性相关算法 在文本、图片、数组相似 等领域的应用 - 2 smlar插件详解》
201701/20170116_02.md 《PostgreSQL结合余弦、线性相关算法 在文本、图片、数组相似 等领域的应用 - 1 文本(关键词)分析理论基础 - TF(Term Frequency 词频)/IDF(Inverse Document Frequency 逆向文本频率)》
201701/20170112_02.md 《导购系统 - 电商内容去重\内容筛选应用(实时识别转载\盗图\侵权?) - 文本、图片集、商品集、数组相似判定的优化和索引技术》
201701/20170106_04.md 《PostgreSQL 全表 全字段 模糊查询的毫秒级高效实现 - 搜索引擎颤抖了》
201612/20161231_01.md 《从难缠的模糊查询聊开 - PostgreSQL独门绝招之一 GIN , GiST , SP-GiST , RUM 索引原理与技术背景》
201612/20161222_02.md 《从相似度算法谈起 - Effective similarity search in PostgreSQL》
201611/20161118_01.md 《聊一聊双十一背后的技术 - 毫秒分词算啥, 试试正则和相似度》
201608/20160817_01.md 《PostgreSQL 文本数据分析实践之 - 相似度分析》
201605/20160506_02.md 《中文模糊查询性能优化 by PostgreSQL trgm》
201603/20160302_01.md 《PostgreSQL 百亿数据 秒级响应 正则及模糊查询》
201305/20130516_01.md 《PostgreSQL 9.3 pg_trgm imporve support multi-bytes char and gist,gin index for reg-exp search》
相关实践学习
如何一键本地部署PolarDB for PostgreSQL
《PolarDB for PostgreSQL动手实践》系列第一期,带您体验如何本地一键安装快速部署云原生开源数据库PolarDB for PostgreSQL。
相关文章
|
29天前
|
关系型数据库 Serverless 分布式数据库
【公测】PolarDB PostgreSQL版Serverless功能免费使用​!
【公测】PolarDB PostgreSQL版Serverless功能免费使用​,公测于2024年3月28日开始,持续三个月,公测期间可以免费使用!
|
2月前
|
关系型数据库 分布式数据库 数据库
PolarDB PostgreSQL版:Oracle兼容的高性能数据库
PolarDB PostgreSQL版是一款高性能的数据库,具有与Oracle兼容的特性。它采用了分布式架构,可以轻松处理大量的数据,同时还支持多种数据类型和函数,具有高可用性和可扩展性。它还提供了丰富的管理工具和性能优化功能,为企业提供了可靠的数据存储和处理解决方案。PolarDB PostgreSQL版在数据库领域具有很高的竞争力,可以满足各种企业的需求。
|
21天前
|
Docker 容器 关系型数据库
【PolarDB-X从入门到精通】 第四讲:PolarDB分布式版安装部署(源码编译部署)
本期课程将于4月11日19:00开始直播,内容包括源码编译基础知识和实践操作,课程目标是使学员掌握源码编译部署技能,为未来发展奠定基础,期待大家在课程中取得丰富的学习成果!
【PolarDB-X从入门到精通】 第四讲:PolarDB分布式版安装部署(源码编译部署)
|
2月前
|
关系型数据库 Serverless 分布式数据库
PolarDB PostgreSQL版Serverless功能上线公测啦,公测期间免费使用!
Serverless数据库能够使得数据库集群资源随客户业务负载动态弹性扩缩,将客户从复杂的业务资源评估和运维工作中解放出来。PolarDB PostgreSQL版 Serverless提供了CPU、内存、存储、网络资源的实时弹性能力,构建计算与存储分离架构下的 PolarDB PostgreSQL版产品新形态。
|
3月前
|
SQL 关系型数据库 分布式数据库
在PolarDB for PostgreSQL中,你可以使用LIKE运算符来实现类似的查询功能,而不是使用IF函数
在PolarDB for PostgreSQL中,你可以使用LIKE运算符来实现类似的查询功能,而不是使用IF函数
43 7
|
10月前
|
数据安全/隐私保护
阿里云商标注册流程
很多用户有注册商标的需求,又不知道怎么注册商标。特别是他们想在阿里云注册商标,其实注册商标很简单。商标类型,又分为:文字商标,图形商标,文字图形组合商标。无论你在阿里云是要买域名,买服务器,还是干嘛,首先你都需要注册阿里云账号的。
|
5月前
|
小程序
阿里云商标12月产品优惠信息
没赶上11月优惠的伙伴们看过来,阿里云商标产品本月仍有隐藏福利等着你,优惠覆盖全线产品,部分活动力度不输11月。
|
5月前
|
监控
对傍名牌、搭便车行为SayNo!-阿里云商标异议、无效宣告服务上线啦!
只要运用得当,可以有效防止他人通过商标注册的形式损害自身合法权益!
|
12月前
《阿里云产品手册2022-2023 版》——商标服务
《阿里云产品手册2022-2023 版》——商标服务
|
小程序
功能更新 - 阿里云商标查询小程序全面升级
小云提醒:文末有惊喜福利,走过路过不要错过~
423 0
功能更新 - 阿里云商标查询小程序全面升级

热门文章

最新文章

相关产品

  • 云原生数据库 PolarDB