Posted By

bbrumm on 06/06/17


Tagged

sql Oracle


Versions (?)

Oracle Indexes


 / Published in: SQL
 

URL: https://www.databasestar.com/oracle-sql-indexes

A few examples of creating indexes in Oracle.

  1. CREATE INDEX index_name
  2. ON table_name (COLUMNS);
  3.  
  4. CREATE INDEX idx_emp_id
  5. ON employee (id);
  6.  
  7.  
  8. CREATE BITMAP INDEX index_name
  9. ON table_name (COLUMNS);
  10.  
  11. CREATE BITMAP INDEX idx_emp_gender
  12. ON employee(gender);
  13.  
  14.  
  15. CREATE INDEX idx_emp_ansal
  16. ON employee(annual_salary);
  17.  
  18.  
  19. CREATE INDEX index_name
  20. ON table_name(FUNCTION(column_name));
  21.  
  22.  
  23. CREATE INDEX idx_emp_mthsal
  24. ON employee(annual_salary / 12);
  25.  
  26. ALTER INDEX index_name
  27. RENAME TO new_index_name;
  28.  
  29. ALTER INDEX index_name ON table_name DISABLE;
  30.  
  31. ALTER INDEX index_name ON table_name REBUILD;
  32.  
  33. ALTER INDEX index_name
  34. REBUILD COMPUTE STATISTICS;

Report this snippet  

You need to login to post a comment.