MogDB 学习笔记之 -- 索引失效
[[toc]]
# 概念描述
哪些操作会导致分区表的全局索引失效(比如 move partition,drop partition ,truncate partition ,split partition , merge partitions )
# 测试验证
1、环境准备
```
CREATE TABLE t_ran
(
user_number NUMBER(11),
start_time timestamp(0) without time zone,
business_name character(2000),
ng_staff_id character(50)
)
PARTITION BY RANGE (start_time)
(PARTITION PART_20180228 VALUES LESS THAN (TO_DATE('2018-03-01','YYYY-MM-DD')),
PARTITION PART_20180301 VALUES LESS THAN (TO_DATE('2018-03-02','YYYY-MM-DD')),
PARTITION PART_20180302 VALUES LESS THAN (TO_DATE('2018-03-03','YYYY-MM-DD')),
PARTITION PART_20180303 VALUES LESS THAN (TO_DATE('2018-03-04','YYYY-MM-DD')),
PARTITION PART_20180304 VALUES LESS THAN (TO_DATE('2018-03-05','YYYY-MM-DD')),
PARTITION PART_20180305 VALUES LESS THAN (TO_DATE('2018-03-06','YYYY-MM-DD')),
PARTITION PART_20180306 VALUES LESS THAN (TO_DATE('2018-03-07','YYYY-MM-DD')),
PARTITION PART_20180307 VALUES LESS THAN (TO_DATE('2018-03-08','YYYY-MM-DD')),
PARTITION PART_20180308 VALUES LESS THAN (TO_DATE('2018-03-09','YYYY-MM-DD')),
PARTITION PART_20180309 VALUES LESS THAN (TO_DATE('2018-03-10','YYYY-MM-DD')),
PARTITION PART_20180310 VALUES LESS THAN (TO_DATE('2018-03-11','YYYY-MM-DD')),
PARTITION PART_20180311 VALUES LESS THAN (TO_DATE('2018-03-12','YYYY-MM-DD')),
PARTITION PART_20180312 VALUES LESS THAN (TO_DATE('2018-03-13','YYYY-MM-DD')),
PARTITION PART_20180313 VALUES LESS THAN (TO_DATE('2018-03-14','YYYY-MM-DD')),
PARTITION PART_20180314 VALUES LESS THAN (TO_DATE('2018-03-15','YYYY-MM-DD')),
PARTITION PART_20180315 VALUES LESS THAN (TO_DATE('2018-03-16','YYYY-MM-DD')),
PARTITION PART_20180316 VALUES LESS THAN (TO_DATE('2018-03-17','YYYY-MM-DD')),
PARTITION PART_20180317 VALUES LESS THAN (TO_DATE('2018-03-18','YYYY-MM-DD')),
PARTITION PART_20180318 VALUES LESS THAN (TO_DATE('2018-03-19','YYYY-MM-DD')),
PARTITION PART_20180319 VALUES LESS THAN (TO_DATE('2018-03-20','YYYY-MM-DD')),
PARTITION PART_20180320 VALUES LESS THAN (TO_DATE('2018-03-21','YYYY-MM-DD')),
PARTITION PART_20180321 VALUES LESS THAN (TO_DATE('2018-03-22','YYYY-MM-DD')),
PARTITION PART_20180322 VALUES LESS THAN (TO_DATE('2018-03-23','YYYY-MM-DD')),
PARTITION PART_20180323 VALUES LESS THAN (TO_DATE('2018-03-24','YYYY-MM-DD')),
PARTITION PART_20180324 VALUES LESS THAN (TO_DATE('2018-03-25','YYYY-MM-DD')),
PARTITION PART_20180325 VALUES LESS THAN (TO_DATE('2018-03-26','YYYY-MM-DD')),
PARTITION PART_20180326 VALUES LESS THAN (TO_DATE('2018-03-27','YYYY-MM-DD')),
PARTITION PART_20180327 VALUES LESS THAN (TO_DATE('2018-03-28','YYYY-MM-DD')),
PARTITION PART_20180328 VALUES LESS THAN (TO_DATE('2018-03-29','YYYY-MM-DD')),
PARTITION PART_20180329 VALUES LESS THAN (TO_DATE('2018-03-30','YYYY-MM-DD')),
PARTITION PART_20180330 VALUES LESS THAN (TO_DATE('2018-03-31','YYYY-MM-DD')),
PARTITION PART_20180331 VALUES LESS THAN (TO_DATE('2018-04-01','YYYY-MM-DD')),
PARTITION PART_max VALUES LESS THAN (MAXVALUE))
;
openGauss=#
openGauss=# \d pg_index
Table "pg_catalog.pg_index"
Column | Type | Modifiers
----------------+--------------+-----------
indexrelid | oid | not null
indrelid | oid | not null
indnatts | smallint | not null
indisunique | boolean | not null
indisprimary | boolean | not null
indisexclusion | boolean | not null
indimmediate | boolean | not null
indisclustered | boolean | not null
indisusable | boolean | not null
indisvalid | boolean | not null
indcheckxmin | boolean | not null
indisready | boolean | not null
indkey | int2vector | not null
indcollation | oidvector | not null
indclass | oidvector | not null
indoption | int2vector | not null
indexprs | pg_node_tree |
indpred | pg_node_tree |
indisreplident | boolean |
indnkeyatts | smallint |
Indexes:
"pg_index_indexrelid_index" UNIQUE, btree (indexrelid) TABLESPACE pg_default
"pg_index_indrelid_index" btree (indrelid) TABLESPACE pg_default
Replica Identity: NOTHING
openGauss=# insert into t_ran select * from customer_t_copy;
INSERT 0 1282751
openGauss=# CREATE INDEX ind_t_ran ON t_ran(start_time) LOCAL;
CREATE INDEX
openGauss=#
openGauss=# CREATE INDEX ind2_t_ran ON t_ran(start_time,user_number) ;
CREATE INDEX
```
2、测试 truncate partition
```
openGauss=# select indexrelid,indisusable,indexrelid::regclass,indrelid::regclass,pg_get_indexdef(indexrelid) from pg_index where indrelid='t_ran'::regclass;
indexrelid | indisusable | indexrelid | indrelid | pg_get_indexdef
------------+-------------+------------+----------+--------------------------------------------------------------------------------------------------------------------------
41104 | t | ind_t_ran | t_ran | CREATE INDEX ind_t_ran ON t_ran USING ubtree (start_time) LOCAL WITH (storage_type=USTORE) TABLESPACE pg_default
41138 | t | ind2_t_ran | t_ran | CREATE INDEX ind2_t_ran ON t_ran USING ubtree (start_time, user_number) WITH (storage_type=USTORE) TABLESPACE pg_default
(2 rows)
openGauss=# alter table t_ran truncate partition part_20180319;
ALTER TABLE
openGauss=# select indexrelid,indisusable,indexrelid::regclass,indrelid::regclass,pg_get_indexdef(indexrelid) from pg_index where indrelid='t_ran'::regclass;
indexrelid | indisusable | indexrelid | indrelid | pg_get_indexdef
------------+-------------+------------+----------+--------------------------------------------------------------------------------------------------------------------------
41104 | t | ind_t_ran | t_ran | CREATE INDEX ind_t_ran ON t_ran USING ubtree (start_time) LOCAL WITH (storage_type=USTORE) TABLESPACE pg_default
41138 | f | ind2_t_ran | t_ran | CREATE INDEX ind2_t_ran ON t_ran USING ubtree (start_time, user_number) WITH (storage_type=USTORE) TABLESPACE pg_default
(2 rows)
openGauss=# alter index ind2_t_ran rebuild;
REINDEX
openGauss=#
openGauss=#
openGauss=# select indexrelid,indisusable,indexrelid::regclass,indrelid::regclass,pg_get_indexdef(indexrelid) from pg_index where indrelid='t_ran'::regclass;
indexrelid | indisusable | indexrelid | indrelid | pg_get_indexdef
------------+-------------+------------+----------+--------------------------------------------------------------------------------------------------------------------------
41104 | t | ind_t_ran | t_ran | CREATE INDEX ind_t_ran ON t_ran USING ubtree (start_time) LOCAL WITH (storage_type=USTORE) TABLESPACE pg_default
41138 | t | ind2_t_ran | t_ran | CREATE INDEX ind2_t_ran ON t_ran USING ubtree (start_time, user_number) WITH (storage_type=USTORE) TABLESPACE pg_default
(2 rows)
```
结论:经过以上实验验证,发现 indisusable 字段发生变化,truncate partition 这个操作会导致全局索引失效,分区索引没有影响。
3、测试 split partition
```
openGauss=# select relname,parentid,interval,boundaries from pg_partition where parentid=(select parentid from pg_partition where relname='t_ran' );
relname | parentid | interval | boundaries
---------------+----------+----------+-------------------------
t_ran | 40968 | |
part_20180301 | 40968 | | {"2018-03-02 00:00:00"}
part_20180302 | 40968 | | {"2018-03-03 00:00:00"}
part_20180303 | 40968 | | {"2018-03-04 00:00:00"}
part_20180304 | 40968 | | {"2018-03-05 00:00:00"}
part_20180305 | 40968 | | {"2018-03-06 00:00:00"}
part_20180306 | 40968 | | {"2018-03-07 00:00:00"}
part_20180307 | 40968 | | {"2018-03-08 00:00:00"}
part_20180308 | 40968 | | {"2018-03-09 00:00:00"}
part_20180309 | 40968 | | {"2018-03-10 00:00:00"}
part_20180310 | 40968 | | {"2018-03-11 00:00:00"}
part_20180311 | 40968 | | {"2018-03-12 00:00:00"}
part_20180312 | 40968 | | {"2018-03-13 00:00:00"}
part_20180313 | 40968 | | {"2018-03-14 00:00:00"}
part_20180316 | 40968 | | {"2018-03-17 00:00:00"}
part_20180317 | 40968 | | {"2018-03-18 00:00:00"}
part_20180318 | 40968 | | {"2018-03-19 00:00:00"}
part_20180319 | 40968 | | {"2018-03-20 00:00:00"}
part_20180320 | 40968 | | {"2018-03-21 00:00:00"}
part_20180322 | 40968 | | {"2018-03-23 00:00:00"}
part_20180323 | 40968 | | {"2018-03-24 00:00:00"}
part_20180324 | 40968 | | {"2018-03-25 00:00:00"}
part_20180326 | 40968 | | {"2018-03-27 00:00:00"}
part_20180327 | 40968 | | {"2018-03-28 00:00:00"}
part_20180328 | 40968 | | {"2018-03-29 00:00:00"}
part_20180330 | 40968 | | {"2018-03-31 00:00:00"}
part_20180331 | 40968 | | {"2018-04-01 00:00:00"}
part_max | 40968 | | {NULL}
(28 rows)
这个是opengauss数据库句法问题,和Oracle数据库语法不一样。
penGauss=# alter table t_ran split partition part_max at (to_date('2018-04-02','YYYY-MM-DD')) into (partition part_20180401,partition part_max);
ERROR: resulting partition "part_max" name conflicts with that of an existing partition
^
--------------------
GAUSS-00923: "resulting partition '%s' name conflicts with that of an existing partition"
SQLSTATE: 42710
错误原因: SPLIT PARTITION操作得到的分区名称与已有分区名冲突,该分割分区操作不能执行。
解决办法: 建议修改结果分区名称。
---------------------
openGauss=# select relname,parentid,interval,boundaries from pg_partition where parentid=(select parentid from pg_partition where relname='t_ran' );
relname | parentid | interval | boundaries
---------------+----------+----------+-------------------------
t_ran | 40968 | |
part_20180301 | 40968 | | {"2018-03-02 00:00:00"}
part_20180302 | 40968 | | {"2018-03-03 00:00:00"}
part_20180303 | 40968 | | {"2018-03-04 00:00:00"}
part_20180304 | 40968 | | {"2018-03-05 00:00:00"}
part_20180305 | 40968 | | {"2018-03-06 00:00:00"}
part_20180306 | 40968 | | {"2018-03-07 00:00:00"}
part_20180307 | 40968 | | {"2018-03-08 00:00:00"}
part_20180308 | 40968 | | {"2018-03-09 00:00:00"}
part_20180309 | 40968 | | {"2018-03-10 00:00:00"}
part_20180310 | 40968 | | {"2018-03-11 00:00:00"}
part_20180311 | 40968 | | {"2018-03-12 00:00:00"}
part_20180312 | 40968 | | {"2018-03-13 00:00:00"}
part_20180313 | 40968 | | {"2018-03-14 00:00:00"}
part_20180316 | 40968 | | {"2018-03-17 00:00:00"}
part_20180317 | 40968 | | {"2018-03-18 00:00:00"}
part_20180318 | 40968 | | {"2018-03-19 00:00:00"}
part_20180320 | 40968 | | {"2018-03-21 00:00:00"}
part_20180322 | 40968 | | {"2018-03-23 00:00:00"}
part_20180323 | 40968 | | {"2018-03-24 00:00:00"}
part_20180324 | 40968 | | {"2018-03-25 00:00:00"}
part_20180326 | 40968 | | {"2018-03-27 00:00:00"}
part_20180327 | 40968 | | {"2018-03-28 00:00:00"}
part_20180328 | 40968 | | {"2018-03-29 00:00:00"}
part_20180330 | 40968 | | {"2018-03-31 00:00:00"}
part_20180331 | 40968 | | {"2018-04-01 00:00:00"}
part_20180319 | 40968 | | {"2018-03-20 00:00:00"}
part_20180401 | 40968 | | {"2018-04-02 00:00:00"}
part_max1 | 40968 | | {NULL}
(29 rows)
openGauss=# alter table t_ran split partition part_max at (to_date('2018-04-02','YYYY-MM-DD')) into (partition part_20180401,partition part_max1);
ALTER TABLE
openGauss=# select indexrelid,indisusable,indexrelid::regclass,indrelid::regclass,pg_get_indexdef(indexrelid) from pg_index where indrelid='t_ran'::regclass;
indexrelid | indisusable | indexrelid | indrelid | pg_get_indexdef
------------+-------------+------------+----------+--------------------------------------------------------------------------------------------------------------------------
41104 | t | ind_t_ran | t_ran | CREATE INDEX ind_t_ran ON t_ran USING ubtree (start_time) LOCAL WITH (storage_type=USTORE) TABLESPACE pg_default
41138 | f | ind2_t_ran | t_ran | CREATE INDEX ind2_t_ran ON t_ran USING ubtree (start_time, user_number) WITH (storage_type=USTORE) TABLESPACE pg_default
(2 rows)
openGauss=# alter index ind2_t_ran rebuild;
REINDEX
openGauss=#
openGauss=# select indexrelid,indisusable,indexrelid::regclass,indrelid::regclass,pg_get_indexdef(indexrelid) from pg_index where indrelid='t_ran'::regclass;
indexrelid | indisusable | indexrelid | indrelid | pg_get_indexdef
------------+-------------+------------+----------+--------------------------------------------------------------------------------------------------------------------------
41104 | t | ind_t_ran | t_ran | CREATE INDEX ind_t_ran ON t_ran USING ubtree (start_time) LOCAL WITH (storage_type=USTORE) TABLESPACE pg_default
41138 | t | ind2_t_ran | t_ran | CREATE INDEX ind2_t_ran ON t_ran USING ubtree (start_time, user_number) WITH (storage_type=USTORE) TABLESPACE pg_default
(2 rows)
openGauss=#
```
结论:经过以上实验验证,发现 indisusable 字段发生变化,split partition 这个操作会导致全局索引失效,分区索引没有影响。
4、测试merge partitions
```
openGauss=# alter table t_ran merge partitions part_20180320,part_20180322 into partition part_20180322;
ALTER TABLE
openGauss=# select indexrelid,indisusable,indexrelid::regclass,indrelid::regclass,pg_get_indexdef(indexrelid) from pg_index where indrelid='t_ran'::regclass;
indexrelid | indisusable | indexrelid | indrelid | pg_get_indexdef
------------+-------------+------------+----------+--------------------------------------------------------------------------------------------------------------------------
41104 | t | ind_t_ran | t_ran | CREATE INDEX ind_t_ran ON t_ran USING ubtree (start_time) LOCAL WITH (storage_type=USTORE) TABLESPACE pg_default
41138 | f | ind2_t_ran | t_ran | CREATE INDEX ind2_t_ran ON t_ran USING ubtree (start_time, user_number) WITH (storage_type=USTORE) TABLESPACE pg_default
(2 rows)
openGauss=# select 'alter index ' || indexrelid::regclass ||' rebuild; ' from pg_index where indisusable='f';
?column?
----------------------------------
alter index ind2_t_ran rebuild;
(1 row)
openGauss=# alter index ind2_t_ran rebuild;
REINDEX
openGauss=#
openGauss=#
openGauss=# select indexrelid,indisusable,indexrelid::regclass,indrelid::regclass,pg_get_indexdef(indexrelid) from pg_index where indrelid='t_ran'::regclass;
indexrelid | indisusable | indexrelid | indrelid | pg_get_indexdef
------------+-------------+------------+----------+--------------------------------------------------------------------------------------------------------------------------
41104 | t | ind_t_ran | t_ran | CREATE INDEX ind_t_ran ON t_ran USING ubtree (start_time) LOCAL WITH (storage_type=USTORE) TABLESPACE pg_default
41138 | t | ind2_t_ran | t_ran | CREATE INDEX ind2_t_ran ON t_ran USING ubtree (start_time, user_number) WITH (storage_type=USTORE) TABLESPACE pg_default
(2 rows)
```
结论:经过以上实验验证,发现 indisusable 字段发生变化,merge partition 这个操作会导致全局索引失效,分区索引没有影响。
5、drop partition
```
openGauss=# alter table t_ran drop partition part_20180322;
ALTER TABLE
openGauss=# select relname,parentid,interval,boundaries from pg_partition where parentid=(select parentid from pg_partition where relname='t_ran' );
relname | parentid | interval | boundaries
---------------+----------+----------+-------------------------
t_ran | 40968 | |
part_20180301 | 40968 | | {"2018-03-02 00:00:00"}
part_20180302 | 40968 | | {"2018-03-03 00:00:00"}
part_20180303 | 40968 | | {"2018-03-04 00:00:00"}
part_20180304 | 40968 | | {"2018-03-05 00:00:00"}
part_20180305 | 40968 | | {"2018-03-06 00:00:00"}
part_20180306 | 40968 | | {"2018-03-07 00:00:00"}
part_20180307 | 40968 | | {"2018-03-08 00:00:00"}
part_20180308 | 40968 | | {"2018-03-09 00:00:00"}
part_20180309 | 40968 | | {"2018-03-10 00:00:00"}
part_20180310 | 40968 | | {"2018-03-11 00:00:00"}
part_20180311 | 40968 | | {"2018-03-12 00:00:00"}
part_20180312 | 40968 | | {"2018-03-13 00:00:00"}
part_20180313 | 40968 | | {"2018-03-14 00:00:00"}
part_20180316 | 40968 | | {"2018-03-17 00:00:00"}
part_20180317 | 40968 | | {"2018-03-18 00:00:00"}
part_20180318 | 40968 | | {"2018-03-19 00:00:00"}
part_20180323 | 40968 | | {"2018-03-24 00:00:00"}
part_20180324 | 40968 | | {"2018-03-25 00:00:00"}
part_20180326 | 40968 | | {"2018-03-27 00:00:00"}
part_20180327 | 40968 | | {"2018-03-28 00:00:00"}
part_20180328 | 40968 | | {"2018-03-29 00:00:00"}
part_20180330 | 40968 | | {"2018-03-31 00:00:00"}
part_20180331 | 40968 | | {"2018-04-01 00:00:00"}
part_20180319 | 40968 | | {"2018-03-20 00:00:00"}
part_20180401 | 40968 | | {"2018-04-02 00:00:00"}
part_max1 | 40968 | | {NULL}
(27 rows)
openGauss=# select indexrelid,indisusable,indexrelid::regclass,indrelid::regclass,pg_get_indexdef(indexrelid) from pg_index where indrelid='t_ran'::regclass;
indexrelid | indisusable | indexrelid | indrelid | pg_get_indexdef
------------+-------------+------------+----------+--------------------------------------------------------------------------------------------------------------------------
41104 | t | ind_t_ran | t_ran | CREATE INDEX ind_t_ran ON t_ran USING ubtree (start_time) LOCAL WITH (storage_type=USTORE) TABLESPACE pg_default
41138 | f | ind2_t_ran | t_ran | CREATE INDEX ind2_t_ran ON t_ran USING ubtree (start_time, user_number) WITH (storage_type=USTORE) TABLESPACE pg_default
(2 rows)
openGauss=# alter index ind2_t_ran rebuild;
REINDEX
openGauss=#
openGauss=#
openGauss=# select indexrelid,indisusable,indexrelid::regclass,indrelid::regclass,pg_get_indexdef(indexrelid) from pg_index where indrelid='t_ran'::regclass;
indexrelid | indisusable | indexrelid | indrelid | pg_get_indexdef
------------+-------------+------------+----------+--------------------------------------------------------------------------------------------------------------------------
41104 | t | ind_t_ran | t_ran | CREATE INDEX ind_t_ran ON t_ran USING ubtree (start_time) LOCAL WITH (storage_type=USTORE) TABLESPACE pg_default
41138 | t | ind2_t_ran | t_ran | CREATE INDEX ind2_t_ran ON t_ran USING ubtree (start_time, user_number) WITH (storage_type=USTORE) TABLESPACE pg_default
(2 rows)
```
结论:经过以上实验验证,发现 indisusable 字段发生变化,drop partition 这个操作会导致全局索引失效,分区索引没有影响。
6、move partition
```
openGauss=# select indexrelid,indisusable,indexrelid::regclass,indrelid::regclass,pg_get_indexdef(indexrelid) from pg_index where indrelid='t_ran'::regclass;
indexrelid | indisusable | indexrelid | indrelid | pg_get_indexdef
------------+-------------+------------+----------+--------------------------------------------------------------------------------------------------------------------------
41138 | t | ind2_t_ran | t_ran | CREATE INDEX ind2_t_ran ON t_ran USING ubtree (start_time, user_number) WITH (storage_type=USTORE) TABLESPACE pg_default
41104 | t | ind_t_ran | t_ran | CREATE INDEX ind_t_ran ON t_ran USING ubtree (start_time) LOCAL WITH (storage_type=USTORE) TABLESPACE pg_default
(2 rows)
openGauss=# alter table t_ran move partition part_20180401 TABLESPACE pg_default;
ALTER TABLE
openGauss=# select indexrelid,indisusable,indexrelid::regclass,indrelid::regclass,pg_get_indexdef(indexrelid) from pg_index where indrelid='t_ran'::regclass;
indexrelid | indisusable | indexrelid | indrelid | pg_get_indexdef
------------+-------------+------------+----------+--------------------------------------------------------------------------------------------------------------------------
41138 | t | ind2_t_ran | t_ran | CREATE INDEX ind2_t_ran ON t_ran USING ubtree (start_time, user_number) WITH (storage_type=USTORE) TABLESPACE pg_default
41104 | t | ind_t_ran | t_ran | CREATE INDEX ind_t_ran ON t_ran USING ubtree (start_time) LOCAL WITH (storage_type=USTORE) TABLESPACE pg_default
(2 rows)
miao=> CREATE TABLESPACE ds_tbs RELATIVE LOCATION 'db_tbs/';
CREATE TABLESPACE
miao=> \q
[omm@db1 db1]$
openGauss=# alter table t_ran move partition part_20180401 TABLESPACE ds_tbs;
ALTER TABLE
openGauss=# select indexrelid,indisusable,indexrelid::regclass,indrelid::regclass,pg_get_indexdef(indexrelid) from pg_index where indrelid='t_ran'::regclass;
indexrelid | indisusable | indexrelid | indrelid | pg_get_indexdef
------------+-------------+------------+----------+--------------------------------------------------------------------------------------------------------------------------
41138 | t | ind2_t_ran | t_ran | CREATE INDEX ind2_t_ran ON t_ran USING ubtree (start_time, user_number) WITH (storage_type=USTORE) TABLESPACE pg_default
41104 | t | ind_t_ran | t_ran | CREATE INDEX ind_t_ran ON t_ran USING ubtree (start_time) LOCAL WITH (storage_type=USTORE) TABLESPACE pg_default
(2 rows)
openGauss=#
```
结论:经过以上实验验证,发现 indisusable 字段没有变化,move partition 这个操作对全局索引和分区索引没有影响。
# 知识总结
1、truncate partition
全局索引:失效
分区索引:正常、没影响
2、split partition
全局索引:失效
分区索引:正常、没影响
3、merge partitions
全局索引:失效
分区索引:正常、没影响
4、drop partition
全局索引:失效
分区索引:正常、没影响
5、move partition
全局索引:正常、没影响
分区索引:正常、没影响
MogDB 学习笔记之 -- 索引失效的更多相关文章
- Linux~学习笔记目录索引
回到占占推荐博客索引 本篇文章是对自己学习Linux及在它的环境下部署工具的一个总结,以方便自己查阅,也给他人一个帮助,本文章同时会不断的更新,欢迎大家订阅! 本目录包括的内容会包括linux基础命令 ...
- Nginx学习笔记~目录索引
回到占占推荐博客索引 前几天整理了<Docker的学习笔记索引>,受到了很多朋友的关注,今天把Nginx的文章也整理一下,以后将永久更新,像大叔之前的<EF文章系列>,< ...
- MongoDB学习笔记-04 索引
索引是用来加速查询的.有了索引之后,数据库不必进行全表扫描,只需先在索引中查找,再根据找到的索引查找数据.MongoDB的索引几乎和传统关系型数据库一样. 创建索引 创建索引是在相应的集合中使用ens ...
- MS SqlServer学习笔记(索引)
1.索引分类 MS SqlServer提供了两种索引:聚集索引和非聚集索引: 聚集索引是将数据按照索引的顺序存放 非聚集索引是将索引和数据分离存放,通过指针将二者联系到一起. 因为两种索引对比: 使用 ...
- MySQL学习笔记(三)—索引
一.概述 1.基本概念 在大型数据库中,一张表中要容纳几万.几十万,甚至几百万的的数据,而当这些表与其他表连接后,所得到的新的数据数目更是要大大超出原来的表.当用户检索这么大量的数据时,经 ...
- 【Oracle学习笔记】索引
1 简介 1)索引是数据库对象之一,用于加快数据的检索,类似于书籍的索引.在数据库中索引可以减少数据库程序查询结果时需要读取的数据量,类似于在书籍中我们利用索引可以不用翻阅整本书即可找到想要的信息. ...
- MySQL实战45讲学习笔记:索引(第五讲)
一.需要回表的案例 在下面表T中,执行下面语句,需要执行几次树的搜索操作?会扫描多少行? select * from T where k between 3 and 5 1.初始化语句 mysql&g ...
- MySQL实战45讲学习笔记:索引(第四讲)
一.索引模型 1.索引的作用: 索引的出现其实是为了提高数据查询的效率,就像书的目录一样 提高数据查询效率 2.索引模型的优缺点比较 二.InnoDB索引模型 1.二叉树是搜索效率最高的,但是实际上大 ...
- mysql学习笔记--数据库索引
一.索引的优点:查询速度快 二.索引的缺点: 1. 增.删.改(数据操作语句)效率低了 2. 索引占用空间 三.索引类型: 1. 普通索引 2. 唯一索引(唯一键) 3. 主键索引:只要主键就自动创建 ...
- MySQL 5.6学习笔记(索引的创建与删除)
1. 创建索引 1.1 创建新表时同时建立索引 语法: create table table_name[col_name data_type] [unique|fulltext|spatial][in ...
随机推荐
- pycharm恢复删除文档与查询修改前数据
1.pycharm恢复删除文档 第一步: 第二步: 2.pycharm查询修改前文档数据 第一步: 第二步:
- Go适合做什么?为何这么多人偏爱Go语言?
Go作为Google2009年推出的语言,其被设计成一门应用于搭载 Web 服务器,存储集群或类似用途的巨型中央服务器的系统编程语言. 对于高性能分布式系统领域而言,Go 语言无疑比大多数其它语言有着 ...
- JS加载层
花了些时间封装了一个JS类,内置9种图标样式,全局主要样式可自定义. 转载请附上本文链接! 全局配置 { "msg": "文字,默认: "loading...& ...
- S2-048 CVE-2017-9791 远程命令执行
漏洞名称 S2-048 CVE-2017-9791 远程命令执行 利用条件 Struts 2.3.x 开启Struts 1 plugin and Struts 1 action插件 漏洞原理 漏洞产生 ...
- OPPO 后端开发 一、二面面经
你好,我是 Guide,看了这么多面试成功的经验分享,今天来看一个读者分享的 Oppo 秋招面试失败经历. 面经合集请看:Java面试题&面经精选集. 下面是正文(文中的我为读者本人). 个人 ...
- ABP Framework 手动升级指南:从6.0.1升级到7.0.0
ABP 7.0.0 正式版已经发布,ABP-Framework-All-In-One 项目同步升级. LeptonX Lite Theme 目前还没有包含在源码解决方案中,还是以 Nuget 包提供, ...
- iOS Reveal 4 安装详解简单粗暴
项目在测试的时候,然后拿了公司最低配置的ipod 来装我们的项目,但是呢,我们的项目居然掉帧很厉害,然后看了一下别人的app,居然不卡,然后就想去看看,别人是怎么做到的.然后呢?就走上了Reveal之 ...
- Django推导流程,Django模块的下载和基本使用、Django的应用和目录结构讲解、Django三板斧
今日内容 纯手撸web框架 1.web框架的本质: 理解1:连接前端与数据库的中间介质 理解2:socket服务端 2.手写web框架: 1.编写socket服务端代码 import socket s ...
- Bootstrap Blazor Viewer 图片浏览器 组件更新, 支持流转图片(ImageFromStream), 用于本地项目例如 MAUI Blazor,Blazor hybrid
示例: https://blazor.app1.es/viewer 使用方法: 1.nuget包 BootstrapBlazor.Viewer 2._Imports.razor 文件 或者页面添加 添 ...
- Docker安装与卸载(基本命令)
Dockers的安装搭建 参考: https://www.cnblogs.com/jxxiaocao/p/12069139.html 采用apt源安装Docker的其他组件时,新组件与已安装的Dock ...