创建表:
CREATE TABLE public.personal
(
id bigserial NOT NULL PRIMARY KEY,
first_name character varying(255) NOT NULL,
last_name character varying(255),
middle_name character varying(255),
deleted integer NOT NULL DEFAULT 0
);
询问:
select last_name, first_name, middle_name, similarity(concat_ws(' ', last_name, first_name, middle_name), 'Smit') AS sml
from personal ORDER BY sml DESC LIMIT 100
如何加快这个查询?