又一个复合索引的SQL调优
昨天做了一个STATSPACK报告,今天看了一下,发现有这样一条SQL排在了逻辑读的前列:select * from (select row_.*,rownum rownum_ from (select * from (select ID,TOPIC,CATALOG_ID,POST_TIME, PLAYER_ID, TYPE fro...
in和exists的对比
首先我给出两个等价的SQL:select id,content from player_message where hasread=5 and end_date>sysdate and id not in (select msg_id from messagemapping t where t.playerid =166);select * from (select id...
热点块问题中pctfree的设置
一段时间前做了一个STATSPACK,发现cache buffers chains等待较多,通过对x$bh的查询找到热点对象。(ORACLE9208)SQL> select owner,object_name from dba_objects where data_object_id in (select obj from (sel...
增加复合索引优化SQL的简单过程
待优化SQL:select t2.emperor,t1.* from t1,t2 where t1.countryid=t2.id and t1.CountryId=1010 and t1.DistrictId=1 and playerId<>100T1表上的索引:SQL> select index_name,column_name from user_ind_columns w...