首页 > 其他分享 >MogDB 学习笔记之 -- 索引失效

MogDB 学习笔记之 -- 索引失效

时间:2024-02-19 19:58:11浏览次数:31  
标签:03 00 -- MogDB 索引 ran part 2018 40968

目录

概念描述

哪些操作会导致分区表的全局索引失效(比如 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
全局索引:正常、没影响
分区索引:正常、没影响

标签:03,00,--,MogDB,索引,ran,part,2018,40968
From: https://www.cnblogs.com/xinxin1222/p/18021826

相关文章

  • 665.非递减数列
    完成度:partial-accepted问题:有些情况未考虑到这道题要考虑两个方面,1、数组中最多只能存在多少元素满足nums[i]>nums[i+1]使得数组是一个非递减数列2、修改这个元素后的数列是否是个非递减数列我做题只考虑到第一个条件使得题目只有部分满足条件。所以需要考虑nums[i]和nums[i+......
  • 《程序是怎样跑起来的》第六章:亲自尝试压缩数据
    这本书的第六章中,作者矢泽久雄引领我们进入了数据压缩的神秘世界。数据压缩,对于我们日常生活和工作来说是一个不可或缺的技术。随着信息爆炸的时代,数据量正以惊人的速度增长。不论是存储空间还是网络带宽,都在面临前所未有的压力。因此,如何高效地管理和传输这些数据成为了一个亚待......
  • Mogeaver 连接数据库
    下载安装Mogeaver是一款开源软件,下载地址如下:https://docs.mogdb.io/zh/mogdb/v3.0/mogeaver-release-notes根据您的操作系统选择相应的安装包,下载完成后直接双击安装即可。配置连接串首次打开软件会弹出“创建新连接”窗口,如下图所示选择MogDB在测试连接可能会出现的问题1......
  • 【Azure Function App】在VS Code中,创建好Function App后部署到Azure中,无法选择Subscr
    问题描述在VSCode中,创建好FunctionApp后部署到Azure中,无法选择Subscriptions问题解答对于无法使用VSCode 部署FunctionApp 到Azure,最近有一个更新,导致了AzureResource 插件的 v0.8.0 版本不支持中国区登录目前的解决办法是:通过手动安装的方式把VSCode中的Azu......
  • kotlin--Object关键字
    1.匿名内部类Object可以实现,继承一个抽象类的同时,实现多个接口。interfaceA{funfunA()}interfaceB{funfunB()}abstractclassMan{abstractfunfindMan()}funmain(){//这个匿名内部类,在继承了Man类的同时,还实现了A、B两个接口......
  • 记一次oracle单表改分区表 一波三折
    业务上要把单表还差分区表SQL>@seggwx.aopenSEG_MBOWNERSEGMENT_NAMESEG_PART_NAMESEGMENT_TYPESEG_TABLESPACE_NAMEBLOCKSHDRFILHDRBLK------------------------------------------------------------------------------------------------------------------......
  • 磐维2.0 之pg_stat_statements插件
    目录一、概念描述二、安装插件三、pg_stat_statements视图四、pg_stat_statements相关参数五、测试验证一、概念描述pg_stat_statements是pg的一个扩展插件,通常用于统计数据库的资源开销,分析TOPSQL,找出慢查询。二、安装插件testdb=#testdb=#createextensionpg_stat_sta......
  • 《程序是怎样跑起来的》第五章
    程序要先存在存储器中,才能被运行这种方式成为存储程序方式。存储器包括内存和磁盘。而存储在磁盘的顺序要先加载到内存才能运行。磁盘缓存是一块内存空间,用来临时存放从磁盘中读取的数据,当下次访问相同的数据时,就可以直接访问磁盘缓存的数据,从而提高数据访问速度。缓存的设计原......
  • 摘抄
     HBuilderX对vue的支持有多强?分类:HBuilderVueHBuilderX中使用vue,如果是打开vue文件,会自动挂载vue语法库。如果是HTML文件里引用vue框架,需要点右下角的语法提示库,选择vue语法库。我们更推荐开发者使用vue单文件规范,直接打开vue文件。注意:如果文件不在项目下,......
  • 【Flink入门修炼】1-4 Flink 核心概念与架构
    前面几篇文章带大家了解了Flink是什么、能做什么,本篇将带大家了解Flink究竟是如何完成这些的,Flink本身架构是什么样的,让大家先对Flink有整体认知,便于后期理解。一、Flink组件栈Flink是一个分层架构的系统,每一层所包含的组件都提供了特定的抽象,用来服务于上层组件。Flink......