来源于:http://www.cnblogs.com/rootq/archive/2009/02/11/1388043.html SQL> select count(*) from t;COUNT(*)----------5442048****************************SQL> alter table t1 nologging;SQL> insert /*+append*/ into t12 select * from t;5442048 rows created.
SQL> select count(*) from t;COUNT(*)----------5442048****************************SQL> alter table t1 nologging;SQL> insert /*+append*/ into t12 select * from t;5442048 rows created.Elapsed: 00:00:55.73****************************SQL> create ta
需求:由于项目变态,需要在一个比较短时间段急剧增加数据库记录(两三天内,由于0增加至5亿).在整个过程调优过程非常艰辛 思路: (1)提高数据库插入性能中心思想:尽量将数据一次性写入到Data File和减少数据库的checkpoint 操作.这次修改了下面四个配置项: 1)将 innodb_flush_log_at_trx_commit 配置设定为0:按过往经验设定为0,插入速度会有很大提高. 0: Write the log buffer to the log file and flush
一,没有优化的速度:Executed in 69.436 seconds drop table t purge;create table t(x int);/*清空共享池,注意在生产环境中千万不能做这步操作*/alter system flush shared_pool; create or replace procedure proc1as begin for i in 1 .. 100000 loop execute immediate 'insert into
(1)-SQLite忽略大小写查询大部分数据库在进行字符串比较时,对大小写是不敏感的.但是SQLite却是大小写敏感的.如果想让SQLite忽略大小写,方法如下:方法一:使用大小写转换函数LOWER.UPPERSELECT * FROM User WHERE LOWER(UserName) = ‘user1′;方法二:在进行比较时强制声明不区分大小写SELECT * FROM User WHERE UserName = ‘user1′ COLLATE NOCASE;方法三:创建表时声明该列不区分
请参考 http://www.3lian.com/edu/2013/07-15/80916.html 分表查询 select * from ( select * from user0 union select * from user1 union select * from user2 union select * from user3) as t order by t.id