oracle資料庫建立索引

2021-09-01 05:11:05 字數 329 閱讀 1375

系統中有一張記錄登入和登出的日誌表,時間長了之後,資料量很大,又沒有歷史表。

而客戶端登入時都會去資料庫查詢使用者上次登入的ip和時間,由於沒有索引所以很慢有時侯。

故需要對此表加入索引,一提高查詢效率

首先先查下表中存在哪些索引

select index_name from all_indexes where table_name = 'syslog';
如果不存在指定欄位的索引,則進行建立

create index pk_syslog on m_traderlog(id);

關於ORACLE建立資料庫索引

由於公司電子商務 平台版本老化,且使用oracle資料庫,前期dba在設計資料庫建表結構時候存在一定的問題,對索引的使用不夠重視,大致資料的查詢比較慢 當然也有一些由於使用hibernate中不夠重視 color red oracle採用自下而上的順序解 析where子句,根據這個原理,表之間的連線...

oracle 資料庫如何建立索引 如何用索引

我現在有乙個sql語句 select faqid,faqname,type,creator,toquestion,supercode from t kbs faq t where type 1 and faqid faqid and faqname like faqname and creator ...

資料庫建立索引

建立索引 學生學號建立聚集索引 create unique clustered index ix student id on student studentid 規則 create unique clustered nonclustered index 索引名 on 表名 檢視名 索引列名,asc ...