12c以前非分区表需要转换为分区, 如果不停业务的话可以使用在线重定义,只有在表进行切换的时候会有短暂的锁表. 12c 中alter table online clause 实现了表上现有的索引有效,又不停业务. 测试一:非分区表转分区表,索引转换为oracle内部规则.-- 建非分区表create table andy_clause as select * from user_objects where object_id is not null;--创建非分区表索引create inde
之前没特别注意,在有些场景下希望使用并行索引扫描的时候,发现parallel_index hint并没有生效,于是抽空看了下文档:The PARALLEL_INDEX hint instructs the optimizer to use the specified number of concurrent servers to parallelize index range scans for partitioned indexes. 但是有很多表即使实时数据量有上千万,但是也无法做到合理的维
MYSQL批量插入数据库实现语句性能分析 假定我们的表结构如下 代码如下 CREATE TABLE example (example_id INT NOT NULL,name VARCHAR( 50 ) NOT NULL,value VARCHAR( 50 ) NOT NULL,other_value VARCHAR( 50 ) NOT NULL) 通常情况下单条插入的sql语句我们会这么写: 代码如下 INSERT INTO example(example_id, name, valu
查看表的分布状况mysql> select count(*) from justin;+----------+| count(*) |+----------+| 5845246 |+----------+1 row in set (0.00 sec) mysql> select month(create_time),count(*) from justin group by month(create_time);+-----------------------+----------+|