-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathut2.session.sql
55 lines (44 loc) · 1.23 KB
/
ut2.session.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
-- delete from users
EXPLAIN
SELECT *
from users
limit 1 CREATE FULLTEXT INDEX FULLTEXT_PASSword ON jp_article(content);
CREATE FULLTEXT INDEX FULLTEXT_title ON jp_article(title);
select count(1)
from jp_article
where match (title) AGAINST ('工作');
EXPLAIN
select id,
title,
match (title) AGAINST ('工作') as relevance
from jp_article
order by relevance desc;
-- delete from jp_article
select id,
url,
title,
content
from jp_article
limit 10, 100;
show table status
-- check table size in disk mb unit
SELECT (data_length + index_length) / power(1024, 2) tablesize_mb
FROM information_schema.tables
WHERE table_schema = 'ut2'
and table_name = 'jp_article';
-- 创建全文索引
-- https://www.cnblogs.com/huanzi-qch/p/15238604.html
-- mairadb has not support ngram yet
-- https://jira.mariadb.org/browse/MDEV-10267
CREATE FULLTEXT INDEX FULLTEXT_content ON jp_article(content) WITH PARSER ngram;
SHOW CREATE TABLE `ut2`.`jp_article`;
SHOW CREATE TABLE authorities;
CREATE FULLTEXT INDEX FULLTEXT_url ON jp_article(url);
select count(1)
from jp_article
where match (url) AGAINST ('呀');
show create DATABASE ut2;
select VERSION();
SHOW PROCESSLIST ;
create database if not exists ut3 character set utf8mb4 ;
desc users;