The CREATE TABLE ` resume_feature_simhash ` (
` resume_id ` varchar (36) NOT NULL,
DEFAULT NULL ` real_name ` varchar (50),
` last_name ` varchar (10) DEFAULT NULL,
` school ` varchar (128) the DEFAULT NULL,
DEFAULT NULL ` pinyin_name ` varchar (50),
` real_name_sim ` bigint (11) the DEFAULT NULL
` pinyin_name_sim ` bigint (11) the DEFAULT NULL,
` company_sim ` bigint (11) the DEFAULT NULL,
` major_sim ` bigint (11) the DEFAULT NULL,
` school_sim ` bigint (11) the DEFAULT NULL,
` title_sim ` bigint (11) the DEFAULT NULL,
` work_start_date ` datetime (6) the DEFAULT NULL,
` edu_start_date ` datetime (6) the DEFAULT NULL,
` edu_end_date ` datetime (6) the DEFAULT NULL,
` union_id ` varchar (36) DEFAULT NULL,
` firm_id ` varchar (36) DEFAULT NULL,
` created ` datetime DEFAULT NULL,
` updated ` datetime DEFAULT NULL,
PRIMARY KEY (` resume_id `),
The KEY ` IX_resume_feature_unionId ` (` union_id `) USING BTREE,
The KEY ` IX_resume_feature_firmId ` (` firm_id `) USING BTREE,
The KEY ` IX_resume_feature_name ` (` real_name `) USING BTREE,
The KEY ` IX_resume_feature_pinyin_name ` (` pinyin_name `) USING BTREE,
The KEY ` IX_resume_feature_name_realname_unionid ` (` real_name `, ` union_id `),
The KEY ` IX_resume_feature_realname_firmId ` (` real_name `, ` firm_id `),
The KEY ` IX_resume_feature_pinyin_unionId ` (` pinyin_name `, ` union_id `),
The KEY ` IX_resume_feature_pinyin_firmId ` (` pinyin_name `, ` firm_id `),
The KEY ` IX_resume_feature_lastname_unionId ` (` last_name `, ` union_id `),
The KEY ` IX_resume_feature_lastname_firmId ` (` last_name `, ` firm_id `),
The KEY ` IX_resume_feature_lastname_school_unionId ` (` last_name `, ` school `, ` union_id `),
The KEY ` IX_resume_feature_lastname_school_firmId ` (` last_name `, ` school `, ` firm_id `)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
Above is built predicate sentence, there is a query from here out of the corresponding records, such as
SELECT
*
The FROM
Resume_feature_simhash
WHERE
Union_id IN (
"A7e40258 a4d - 8591-4-87 a8 - f307266cd163",
Cc7 e6b "a7eb0277-5-4-8 e91e67f8b b14-601",
"A7eb037d - b491-401 - a - 9 ecc - b1bc060679e2",
"E1 a7f5042f - 88-47 b0743049 b3-9308-2818",
"A8bc022d bc7 ed81-4-81 a3 - fe0b0bfabdb6",
"B6462e7b e7 - b8af - 70106-8962-11 fb01274",
"B6464f70 e7 - b8af - 70106-8962-11 fb01274",
"B6479575 e7 - b8af - 70106-8962-11 fb01274",
"B647a889 e7 - b8af - 70106-8962-11 fb01274",
"B64f5539 e7 - b8af - 70106-8962-11 fb01274",
"B66494ae e7 - b8af - 70106-8962-11 fb01274",
"B66a3ded e7 - b8af - 70106-8962-11 fb01274",
"B66ac9da e7 - b8af - 70106-8962-11 fb01274",
"B66bfcb0 e7 - b8af - 70106-8962-11 fb01274",
"A8ef02fd - a6e c432-4-9526 - c5e2606d5ae2"
)
AND last_name='more than'
When the target data to 3 w need 3 s, almost every increase 1 w time will need to increase 1 s, queries are used to index, the following
Now the question is, is there any way to 3 w (any quantity) read into memory time compression for less than 1 s
CodePudding user response:
Refer to this, to optimize the SQL statements may a bit faster, but a large amount of data query efficiency, affected by various optimization point is more than the SQL statement:https://blog.csdn.net/jie_liang/article/details/77340905
CodePudding user response:
Through the following methods to analyze where time is spent on,
The