SlideShare a Scribd company logo
INDEXES AND INDEXING
IN ORACLE 12C
© Oren Nakdimon
Oren Nakdimon
www.db-oriented.com
 oren@db-oriented.com
 +972-54-4393763
@DBoriented
This presentation is available in http://db-oriented.com/presentations
©OrenNakdimon
WHO AM I?
A CHRONOLOGY BY “ORACLE YEARS”
When What Where
Oracle 6/7 1991-1997 Developer IAF
Oracle 8 1997-1998 Server Group Manager Golden Screens
Oracle 8i/9i 1998-2003 DBA Group Manager TELEknowledge
Oracle 10g/11g 2004-2011 VP R&D and
Israel Site Manager
Olista
Oracle 11g/12c 2011-2015 Freelance Consultant
2015- Database Expert
http://www.db-oriented.com/blog [English]
http://www.db-oriented.com/blog-2 [Hebrew]
This presentation is available in http://db-oriented.com/presentations
©OrenNakdimon
AGENDA
 Multiple indexes on the same column list
 Indexes and extended strings
 Online operations
 Asynchronous global index maintenance
 Partial indexes
 Advanced index compression
This presentation is available in http://db-oriented.com/presentations
©OrenNakdimon
THE USUAL WARNING
 Before you decide to apply any of the presented
features in production, make sure:
 to thoroughly test them for your applications and
environments
 that you have the required license to use them
Multiple Indexes on the Same
Column List
This presentation is available in http://db-oriented.com/presentations
©OrenNakdimon
INVISIBLE INDEXES (11G)
 An invisible index is:
 Maintained by DML
 Invisible to the optimizer
 Unless optimizer_use_invisible_indexes is true
@iind
This presentation is available in http://db-oriented.com/presentations
©OrenNakdimon
MULTIPLE INDEXES ON THE SAME COLUMN LIST
 Before 12c
 Impossible to define several indexes on the same
column list
 In 12c
 It is possible, as long as
 Only one of the indexes is visible
 The indexes are different somehow; for example:
 Unique vs. non-unique
 B*tree vs. bitmap
 Partitioned vs. non-partitioned
@mind
Extended Strings
This presentation is available in http://db-oriented.com/presentations
©OrenNakdimon
EXTENDED STRINGS
 By default, maximum length of:
 VARCHAR2 and NVARCHAR2 columns is 4KB
 RAW columns is 2KB
 If MAX_STRING_SIZE = EXTENDED, it is 32KB
 Implemented like LOBs
 SQL string functions can return 32KB
@32k
This presentation is available in http://db-oriented.com/presentations
©OrenNakdimon
EXTENDED STRINGS – ENABLING
 MAX_STRING_SIZE can be changed from
STANDARD to EXTENDED, but not from
EXTENDED to STANDARD
 COMPATIBLE must be set to 12.0.0.0 or higher
 Can be done only in UPGRADE mode
 The script utl32k.sql must be executed
 Objects may be invalidated
 Instructions:
http://docs.oracle.com/cloud/latest/db121/REF
RN/refrn10321.htm
Online DDL Operations
This presentation is available in http://db-oriented.com/presentations
©OrenNakdimon
ONLINE DDL OPERATIONS
 In 12c more operations can be executed online:
 ALTER INDEX VISIBLE
 ALTER INDEX INVISIBLE
 DROP INDEX ONLINE
 ALTER INDEX UNUSABLE ONLINE
 ALTER TABLE MOVE SUB/PARTITION ONLINE
@online1|2|3|4
This presentation is available in http://db-oriented.com/presentations
©OrenNakdimon
ONLINE DDL OPERATIONS
Offline Operations Online Operations
This presentation is available in http://db-oriented.com/presentations
©OrenNakdimon
ONLINE DDL OPERATIONS
Offline Operations Online Operations
Get ORA-54 due to active
transactions
Wait for active transactions to
end
This presentation is available in http://db-oriented.com/presentations
©OrenNakdimon
ONLINE DDL OPERATIONS
Offline Operations Online Operations
Get ORA-54 due to active
transactions
Wait for active transactions to
end
Block new DML statements Do not block new DML
statements
This presentation is available in http://db-oriented.com/presentations
©OrenNakdimon
ONLINE DDL OPERATIONS
Offline Operations Online Operations
Get ORA-54 due to active
transactions
Wait for active transactions to
end
Block new DML statements Do not block new DML
statements
ALTER INDEX UNUSABLE drops
the index segment
ALTER INDEX UNUSABLE keeps
the index segment
This presentation is available in http://db-oriented.com/presentations
©OrenNakdimon
ONLINE DDL OPERATIONS
Offline Operations Online Operations
Get ORA-54 due to active
transactions
Wait for active transactions to
end
Block new DML statements Do not block new DML
statements
ALTER INDEX UNUSABLE drops
the index segment
ALTER INDEX UNUSABLE keeps
the index segment
MOVE PARTITION may lead to
unusable indexes
MOVE PARTITION keeps the
indexes usable
Asynchronous Global Index
Maintenance
This presentation is available in http://db-oriented.com/presentations
©OrenNakdimon
ASYNC GLOBAL INDEX MAINTENANCE
 DROP/TRUNCATE PARTITION
 Before 12c: either fast operation or keeping global
indexes usable
 In 12c: both fast operation and keeping global
indexes usable
 New data dictionary column
ORPHANED_ENTRIES
 Orphaned index entries are:
 Not deleted as part of the operation
 Not reused (usually)
@async1
This presentation is available in http://db-oriented.com/presentations
©OrenNakdimon
ASYNC GLOBAL INDEX MAINTENANCE
 Cleaning out the orphaned entries:
 Alter index rebuild
 Alter index coalesce cleanup
 DBMS_PART.CLEANUP_GIDX
 PMO_DEFERRED_GIDX_MAINT_JOB
@async2
Partial Indexes
This presentation is available in http://db-oriented.com/presentations
©OrenNakdimon
PARTIAL INDEXES
 In 12c it is possible to create an index on a
subset of partitions
 Supported for both local and global indexes
 The optimizer is aware of it
 INDEXING ON | INDEXING OFF
 At table/partition level
 INDEXING PARTIAL
 At index level
 New data dictionary columns: INDEXING
@pind
Advanced Index Compression
This presentation is available in http://db-oriented.com/presentations
©OrenNakdimon
INDEX COMPRESSION CONCEPT
CREATE INDEX PEOPLE_IDX ON PEOPLE
(LAST_NAME,FIRST_NAME)
Allen,Alex,rowid
Allen,Barbara,rowid
Allen,David,rowid
Allen,James,rowid
Allen,John,rowid
Allen,Linda,rowid
Allen,Mary,rowid
Allen,Michael,rowid
Allen,Patricia,rowid
Allen,Robert,rowid
Blake,David,rowid
Blake,James,rowid
Blake,Lisa,rowid
Blake,Maria,rowid
Blake,William,rowid
#1=Allen
#2=Blake
#1,Alex,rowid
#1,Barbara,rowid
#1,David,rowid
#1,James,rowid
#1,John,rowid
#1,Linda,rowid
#1,Mary,rowid
#1,Michael,rowid
#1,Patricia,rowid
#1,Robert,rowid
#2,David,rowid
#2,James,rowid
#2,Lisa,rowid
#2,Maria,rowid
#2,William,rowid
COMPRESS 1
This presentation is available in http://db-oriented.com/presentations
©OrenNakdimon
INDEX COMPRESSION CONCEPT – CONT.
Smith,Alex,rowid
Smith,Alex,rowid
Smith,Alex,rowid
Smith,Alex,rowid
Smith,Barbara,rowid
Smith,Barbara,rowid
Smith,Barbara,rowid
Smith,Barbara,rowid
Smith,Barbara,rowid
Smith,David,rowid
Smith,David,rowid
Smith,David,rowid
Smith,David,rowid
Smith,David,rowid
Smith,David,rowid
#1=Smith
#1,Alex,rowid
#1,Alex,rowid
#1,Alex,rowid
#1,Alex,rowid
#1,Barbara,rowid
#1,Barbara,rowid
#1,Barbara,rowid
#1,Barbara,rowid
#1,Barbara,rowid
#1,David,rowid
#1,David,rowid
#1,David,rowid
#1,David,rowid
#1,David,rowid
#1,David,rowid
This presentation is available in http://db-oriented.com/presentations
©OrenNakdimon
INDEX COMPRESSION CONCEPT – CONT.
Xa,Alex,rowid
Xander,Barbara,rowid
Xanders,David,rowid
Xanthopoulos,Kevin,rowid
Xanthos,Sandra,rowid
Xavier,Sarah,rowid
Xayachack,Scott,rowid
Xayarath,Martin,rowid
Xayasane,Donna,rowid
Xayavong,Edward,rowid
#1=Xa #2=Xander
#3=Xanders #4=Xanthopoulos
#5=Xanthos #6=Xavier
#7=Xayachack #8=Xayarath
#9=Xayasane #a=Xayavong
#1,Alex,rowid
#2,Barbara,rowid
#3,David,rowid
#4,Kevin,rowid
#5,Sandra,rowid
#6,Sarah,rowid
#7,Scott,rowid
#8,Martin,rowid
#9,Donna,rowid
#a,Edward,rowid
@acmp
This presentation is available in http://db-oriented.com/presentations
©OrenNakdimon
PREFIX INDEX COMPRESSION (SINCE ORACLE8I)
 Implemented in the leaf block level
 May reduce the size of the index
 Today’s optimal prefix length may be suboptimal
tomorrow
 All the index blocks are compressed the same
way
This presentation is available in http://db-oriented.com/presentations
©OrenNakdimon
ADVANCED INDEX COMPRESSION
 Same mechanism, but:
 Each block may be compressed or not
 Each block may have different number of columns in
the prefix table
 And it’s automatic
THANK YOU
Oren Nakdimon
www.db-oriented.com
 oren@db-oriented.com
 +972-54-4393763
@DBoriented
© Oren Nakdimon

More Related Content

What's hot (20)

PDF
SQL
kaushal123
 
PDF
Chapter 4 Structured Query Language
Eddyzulham Mahluzydde
 
PDF
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Zohar Elkayam
 
PDF
Ash architecture and advanced usage rmoug2014
John Beresniewicz
 
PDF
Oracle RAC 19c: Best Practices and Secret Internals
Anil Nair
 
PPT
Creating Views - oracle database
Salman Memon
 
PDF
Oracle MAA (Maximum Availability Architecture) 18c - An Overview
Markus Michalewicz
 
PDF
Oracle db performance tuning
Simon Huang
 
PPTX
Introduction to Oracle Database
puja_dhar
 
PPTX
Top 10 tips for Oracle performance (Updated April 2015)
Guy Harrison
 
PPTX
Sql Functions And Procedures
DataminingTools Inc
 
PDF
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Aaron Shilo
 
PDF
Oracle RAC - New Generation
Anil Nair
 
PDF
Analyzing and Interpreting AWR
pasalapudi
 
PDF
Oracle statistics by example
Mauro Pagano
 
PDF
Partitioning tables and indexing them
Hemant K Chitale
 
PPT
Subqueries -Oracle DataBase
Salman Memon
 
PDF
SQL Joins With Examples | Edureka
Edureka!
 
PPT
Top 10 Oracle SQL tuning tips
Nirav Shah
 
PDF
Oracle Parallel Distribution and 12c Adaptive Plans
Franck Pachot
 
Chapter 4 Structured Query Language
Eddyzulham Mahluzydde
 
Oracle Database Performance Tuning Advanced Features and Best Practices for DBAs
Zohar Elkayam
 
Ash architecture and advanced usage rmoug2014
John Beresniewicz
 
Oracle RAC 19c: Best Practices and Secret Internals
Anil Nair
 
Creating Views - oracle database
Salman Memon
 
Oracle MAA (Maximum Availability Architecture) 18c - An Overview
Markus Michalewicz
 
Oracle db performance tuning
Simon Huang
 
Introduction to Oracle Database
puja_dhar
 
Top 10 tips for Oracle performance (Updated April 2015)
Guy Harrison
 
Sql Functions And Procedures
DataminingTools Inc
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Aaron Shilo
 
Oracle RAC - New Generation
Anil Nair
 
Analyzing and Interpreting AWR
pasalapudi
 
Oracle statistics by example
Mauro Pagano
 
Partitioning tables and indexing them
Hemant K Chitale
 
Subqueries -Oracle DataBase
Salman Memon
 
SQL Joins With Examples | Edureka
Edureka!
 
Top 10 Oracle SQL tuning tips
Nirav Shah
 
Oracle Parallel Distribution and 12c Adaptive Plans
Franck Pachot
 

Viewers also liked (20)

PDF
The Features That (maybe) You Didn't Know About
Oren Nakdimon
 
PDF
Oren nakdimon oh really... i didn't know it is supported in standard edition
Oren Nakdimon
 
PDF
Write Less (code) With More (Oracle Database 12c New Features)
Oren Nakdimon
 
PDF
How to upgrade your application with no downtime (using edition-based redefin...
Oren Nakdimon
 
PDF
Policy based cluster management in oracle 12c
Anju Garg
 
DOCX
Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0
Yury Velikanov
 
PPTX
Oracle 12c Automatic Dynamic Sampling
Igor Usoltsev
 
PDF
Oracle 12c Multi Process Multi Threaded
Markus Flechtner
 
PDF
SQL Monitoring in Oracle Database 12c
Tanel Poder
 
PPTX
Adaptive Query Optimization
Christian Antognini
 
PPT
Less18 moving data
Imran Ali
 
PPTX
Oracle ACFS High Availability NFS Services (HANFS)
Anju Garg
 
PPT
Less09 managing undo data
Imran Ali
 
PPT
Less09 locking
Amit Bhalla
 
PPT
Less10 undo
Amit Bhalla
 
PPT
Adop and maintenance task presentation 151015
andreas kuncoro
 
PPTX
Aphorisms on Information Technology & Systems
Prasad Chitta
 
PPTX
All (that i know) about exadata external
Prasad Chitta
 
PPTX
AOUG_11Nov2016_Challenges_with_EBS12_2
Sean Braymen
 
PDF
Histograms: Pre-12c and now
Anju Garg
 
The Features That (maybe) You Didn't Know About
Oren Nakdimon
 
Oren nakdimon oh really... i didn't know it is supported in standard edition
Oren Nakdimon
 
Write Less (code) With More (Oracle Database 12c New Features)
Oren Nakdimon
 
How to upgrade your application with no downtime (using edition-based redefin...
Oren Nakdimon
 
Policy based cluster management in oracle 12c
Anju Garg
 
Oracle 12c RAC On your laptop Step by Step Implementation Guide 1.0
Yury Velikanov
 
Oracle 12c Automatic Dynamic Sampling
Igor Usoltsev
 
Oracle 12c Multi Process Multi Threaded
Markus Flechtner
 
SQL Monitoring in Oracle Database 12c
Tanel Poder
 
Adaptive Query Optimization
Christian Antognini
 
Less18 moving data
Imran Ali
 
Oracle ACFS High Availability NFS Services (HANFS)
Anju Garg
 
Less09 managing undo data
Imran Ali
 
Less09 locking
Amit Bhalla
 
Less10 undo
Amit Bhalla
 
Adop and maintenance task presentation 151015
andreas kuncoro
 
Aphorisms on Information Technology & Systems
Prasad Chitta
 
All (that i know) about exadata external
Prasad Chitta
 
AOUG_11Nov2016_Challenges_with_EBS12_2
Sean Braymen
 
Histograms: Pre-12c and now
Anju Garg
 
Ad

Similar to Indexes and Indexing in Oracle 12c (20)

PPTX
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
Alex Zaballa
 
PPTX
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
Alex Zaballa
 
PPTX
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Alex Zaballa
 
DOCX
Oracle Database 12c "New features"
Anar Godjaev
 
PPTX
Best New Features of Oracle Database 12c
Pini Dibask
 
PDF
GLOC 2014 NEOOUG - Oracle Database 12c New Features
Biju Thomas
 
PPTX
Oracle 12c
Deborah TIce
 
PPSX
Oracle database 12c new features
Remote DBA Services
 
PPTX
Oracle database 12c new features
RidaZaman1
 
PDF
Aioug vizag oracle12c_new_features
AiougVizagChapter
 
PPTX
What_to_expect_from_oracle_database_12c
Maria Colgan
 
PPT
Less07 schema
Imran Ali
 
PDF
MOUG17 Keynote: Oracle OpenWorld Major Announcements
Monica Li
 
PPTX
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
Alex Zaballa
 
PPTX
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
Alex Zaballa
 
PPTX
Oracle Database 12c - New Features for Developers and DBAs
Alex Zaballa
 
PPTX
Oracle Database 12c - New Features for Developers and DBAs
Alex Zaballa
 
PDF
Reduce planned database down time with Oracle technology
Kirill Loifman
 
PPTX
Whats new in Oracle Database 12c release 12.1.0.2
Connor McDonald
 
PPT
Les 18 space
Femi Adeyemi
 
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
Alex Zaballa
 
OOW16 - Oracle Database 12c - The Best Oracle Database 12c New Features for D...
Alex Zaballa
 
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Alex Zaballa
 
Oracle Database 12c "New features"
Anar Godjaev
 
Best New Features of Oracle Database 12c
Pini Dibask
 
GLOC 2014 NEOOUG - Oracle Database 12c New Features
Biju Thomas
 
Oracle 12c
Deborah TIce
 
Oracle database 12c new features
Remote DBA Services
 
Oracle database 12c new features
RidaZaman1
 
Aioug vizag oracle12c_new_features
AiougVizagChapter
 
What_to_expect_from_oracle_database_12c
Maria Colgan
 
Less07 schema
Imran Ali
 
MOUG17 Keynote: Oracle OpenWorld Major Announcements
Monica Li
 
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
Alex Zaballa
 
OTN TOUR 2016 - DBA Commands and Concepts That Every Developer Should Know
Alex Zaballa
 
Oracle Database 12c - New Features for Developers and DBAs
Alex Zaballa
 
Oracle Database 12c - New Features for Developers and DBAs
Alex Zaballa
 
Reduce planned database down time with Oracle technology
Kirill Loifman
 
Whats new in Oracle Database 12c release 12.1.0.2
Connor McDonald
 
Les 18 space
Femi Adeyemi
 
Ad

More from Oren Nakdimon (9)

PDF
Write Less (Code) With More (Features) [UKOUG 22]
Oren Nakdimon
 
PDF
Design Patterns in PLSQL and SQL [UKOUG 22]
Oren Nakdimon
 
PDF
Oren nakdimon - Write Less With More - UKOUGtogether21
Oren Nakdimon
 
PDF
Oren nakdimon - Design Patterns for PL/SQL and SQL - UKOUGtogether21
Oren Nakdimon
 
PDF
Oren Nakdimon - Oracle SQL Pattern Matching Made Easy
Oren Nakdimon
 
PDF
Oracle Inter-Session Communication
Oren Nakdimon
 
PDF
Constraint Optimization
Oren Nakdimon
 
PDF
Edition Based Redefinition Made Easy - Oren Nakdimon
Oren Nakdimon
 
PDF
Oren nakdimon - Oracle 12c SQL Pattern Matching Made Easy
Oren Nakdimon
 
Write Less (Code) With More (Features) [UKOUG 22]
Oren Nakdimon
 
Design Patterns in PLSQL and SQL [UKOUG 22]
Oren Nakdimon
 
Oren nakdimon - Write Less With More - UKOUGtogether21
Oren Nakdimon
 
Oren nakdimon - Design Patterns for PL/SQL and SQL - UKOUGtogether21
Oren Nakdimon
 
Oren Nakdimon - Oracle SQL Pattern Matching Made Easy
Oren Nakdimon
 
Oracle Inter-Session Communication
Oren Nakdimon
 
Constraint Optimization
Oren Nakdimon
 
Edition Based Redefinition Made Easy - Oren Nakdimon
Oren Nakdimon
 
Oren nakdimon - Oracle 12c SQL Pattern Matching Made Easy
Oren Nakdimon
 

Recently uploaded (20)

PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PDF
Staying Human in a Machine- Accelerated World
Catalin Jora
 
PDF
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
DOCX
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
PDF
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
PDF
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
PDF
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PPTX
Digital Circuits, important subject in CS
contactparinay1
 
DOCX
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
PDF
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
Staying Human in a Machine- Accelerated World
Catalin Jora
 
Agentic AI lifecycle for Enterprise Hyper-Automation
Debmalya Biswas
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Python coding for beginners !! Start now!#
Rajni Bhardwaj Grover
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
SIZING YOUR AIR CONDITIONER---A PRACTICAL GUIDE.pdf
Muhammad Rizwan Akram
 
“Squinting Vision Pipelines: Detecting and Correcting Errors in Vision Models...
Edge AI and Vision Alliance
 
Go Concurrency Real-World Patterns, Pitfalls, and Playground Battles.pdf
Emily Achieng
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
POV_ Why Enterprises Need to Find Value in ZERO.pdf
darshakparmar
 
UiPath DevConnect 2025: Agentic Automation Community User Group Meeting
DianaGray10
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
Digital Circuits, important subject in CS
contactparinay1
 
Cryptography Quiz: test your knowledge of this important security concept.
Rajni Bhardwaj Grover
 
Mastering Financial Management in Direct Selling
Epixel MLM Software
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
Transcript: Book industry state of the nation 2025 - Tech Forum 2025
BookNet Canada
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 

Indexes and Indexing in Oracle 12c

  • 1. INDEXES AND INDEXING IN ORACLE 12C © Oren Nakdimon Oren Nakdimon www.db-oriented.com  [email protected]  +972-54-4393763 @DBoriented
  • 2. This presentation is available in http://db-oriented.com/presentations ©OrenNakdimon WHO AM I? A CHRONOLOGY BY “ORACLE YEARS” When What Where Oracle 6/7 1991-1997 Developer IAF Oracle 8 1997-1998 Server Group Manager Golden Screens Oracle 8i/9i 1998-2003 DBA Group Manager TELEknowledge Oracle 10g/11g 2004-2011 VP R&D and Israel Site Manager Olista Oracle 11g/12c 2011-2015 Freelance Consultant 2015- Database Expert http://www.db-oriented.com/blog [English] http://www.db-oriented.com/blog-2 [Hebrew]
  • 3. This presentation is available in http://db-oriented.com/presentations ©OrenNakdimon AGENDA  Multiple indexes on the same column list  Indexes and extended strings  Online operations  Asynchronous global index maintenance  Partial indexes  Advanced index compression
  • 4. This presentation is available in http://db-oriented.com/presentations ©OrenNakdimon THE USUAL WARNING  Before you decide to apply any of the presented features in production, make sure:  to thoroughly test them for your applications and environments  that you have the required license to use them
  • 5. Multiple Indexes on the Same Column List
  • 6. This presentation is available in http://db-oriented.com/presentations ©OrenNakdimon INVISIBLE INDEXES (11G)  An invisible index is:  Maintained by DML  Invisible to the optimizer  Unless optimizer_use_invisible_indexes is true @iind
  • 7. This presentation is available in http://db-oriented.com/presentations ©OrenNakdimon MULTIPLE INDEXES ON THE SAME COLUMN LIST  Before 12c  Impossible to define several indexes on the same column list  In 12c  It is possible, as long as  Only one of the indexes is visible  The indexes are different somehow; for example:  Unique vs. non-unique  B*tree vs. bitmap  Partitioned vs. non-partitioned @mind
  • 9. This presentation is available in http://db-oriented.com/presentations ©OrenNakdimon EXTENDED STRINGS  By default, maximum length of:  VARCHAR2 and NVARCHAR2 columns is 4KB  RAW columns is 2KB  If MAX_STRING_SIZE = EXTENDED, it is 32KB  Implemented like LOBs  SQL string functions can return 32KB @32k
  • 10. This presentation is available in http://db-oriented.com/presentations ©OrenNakdimon EXTENDED STRINGS – ENABLING  MAX_STRING_SIZE can be changed from STANDARD to EXTENDED, but not from EXTENDED to STANDARD  COMPATIBLE must be set to 12.0.0.0 or higher  Can be done only in UPGRADE mode  The script utl32k.sql must be executed  Objects may be invalidated  Instructions: http://docs.oracle.com/cloud/latest/db121/REF RN/refrn10321.htm
  • 12. This presentation is available in http://db-oriented.com/presentations ©OrenNakdimon ONLINE DDL OPERATIONS  In 12c more operations can be executed online:  ALTER INDEX VISIBLE  ALTER INDEX INVISIBLE  DROP INDEX ONLINE  ALTER INDEX UNUSABLE ONLINE  ALTER TABLE MOVE SUB/PARTITION ONLINE @online1|2|3|4
  • 13. This presentation is available in http://db-oriented.com/presentations ©OrenNakdimon ONLINE DDL OPERATIONS Offline Operations Online Operations
  • 14. This presentation is available in http://db-oriented.com/presentations ©OrenNakdimon ONLINE DDL OPERATIONS Offline Operations Online Operations Get ORA-54 due to active transactions Wait for active transactions to end
  • 15. This presentation is available in http://db-oriented.com/presentations ©OrenNakdimon ONLINE DDL OPERATIONS Offline Operations Online Operations Get ORA-54 due to active transactions Wait for active transactions to end Block new DML statements Do not block new DML statements
  • 16. This presentation is available in http://db-oriented.com/presentations ©OrenNakdimon ONLINE DDL OPERATIONS Offline Operations Online Operations Get ORA-54 due to active transactions Wait for active transactions to end Block new DML statements Do not block new DML statements ALTER INDEX UNUSABLE drops the index segment ALTER INDEX UNUSABLE keeps the index segment
  • 17. This presentation is available in http://db-oriented.com/presentations ©OrenNakdimon ONLINE DDL OPERATIONS Offline Operations Online Operations Get ORA-54 due to active transactions Wait for active transactions to end Block new DML statements Do not block new DML statements ALTER INDEX UNUSABLE drops the index segment ALTER INDEX UNUSABLE keeps the index segment MOVE PARTITION may lead to unusable indexes MOVE PARTITION keeps the indexes usable
  • 19. This presentation is available in http://db-oriented.com/presentations ©OrenNakdimon ASYNC GLOBAL INDEX MAINTENANCE  DROP/TRUNCATE PARTITION  Before 12c: either fast operation or keeping global indexes usable  In 12c: both fast operation and keeping global indexes usable  New data dictionary column ORPHANED_ENTRIES  Orphaned index entries are:  Not deleted as part of the operation  Not reused (usually) @async1
  • 20. This presentation is available in http://db-oriented.com/presentations ©OrenNakdimon ASYNC GLOBAL INDEX MAINTENANCE  Cleaning out the orphaned entries:  Alter index rebuild  Alter index coalesce cleanup  DBMS_PART.CLEANUP_GIDX  PMO_DEFERRED_GIDX_MAINT_JOB @async2
  • 22. This presentation is available in http://db-oriented.com/presentations ©OrenNakdimon PARTIAL INDEXES  In 12c it is possible to create an index on a subset of partitions  Supported for both local and global indexes  The optimizer is aware of it  INDEXING ON | INDEXING OFF  At table/partition level  INDEXING PARTIAL  At index level  New data dictionary columns: INDEXING @pind
  • 24. This presentation is available in http://db-oriented.com/presentations ©OrenNakdimon INDEX COMPRESSION CONCEPT CREATE INDEX PEOPLE_IDX ON PEOPLE (LAST_NAME,FIRST_NAME) Allen,Alex,rowid Allen,Barbara,rowid Allen,David,rowid Allen,James,rowid Allen,John,rowid Allen,Linda,rowid Allen,Mary,rowid Allen,Michael,rowid Allen,Patricia,rowid Allen,Robert,rowid Blake,David,rowid Blake,James,rowid Blake,Lisa,rowid Blake,Maria,rowid Blake,William,rowid #1=Allen #2=Blake #1,Alex,rowid #1,Barbara,rowid #1,David,rowid #1,James,rowid #1,John,rowid #1,Linda,rowid #1,Mary,rowid #1,Michael,rowid #1,Patricia,rowid #1,Robert,rowid #2,David,rowid #2,James,rowid #2,Lisa,rowid #2,Maria,rowid #2,William,rowid COMPRESS 1
  • 25. This presentation is available in http://db-oriented.com/presentations ©OrenNakdimon INDEX COMPRESSION CONCEPT – CONT. Smith,Alex,rowid Smith,Alex,rowid Smith,Alex,rowid Smith,Alex,rowid Smith,Barbara,rowid Smith,Barbara,rowid Smith,Barbara,rowid Smith,Barbara,rowid Smith,Barbara,rowid Smith,David,rowid Smith,David,rowid Smith,David,rowid Smith,David,rowid Smith,David,rowid Smith,David,rowid #1=Smith #1,Alex,rowid #1,Alex,rowid #1,Alex,rowid #1,Alex,rowid #1,Barbara,rowid #1,Barbara,rowid #1,Barbara,rowid #1,Barbara,rowid #1,Barbara,rowid #1,David,rowid #1,David,rowid #1,David,rowid #1,David,rowid #1,David,rowid #1,David,rowid
  • 26. This presentation is available in http://db-oriented.com/presentations ©OrenNakdimon INDEX COMPRESSION CONCEPT – CONT. Xa,Alex,rowid Xander,Barbara,rowid Xanders,David,rowid Xanthopoulos,Kevin,rowid Xanthos,Sandra,rowid Xavier,Sarah,rowid Xayachack,Scott,rowid Xayarath,Martin,rowid Xayasane,Donna,rowid Xayavong,Edward,rowid #1=Xa #2=Xander #3=Xanders #4=Xanthopoulos #5=Xanthos #6=Xavier #7=Xayachack #8=Xayarath #9=Xayasane #a=Xayavong #1,Alex,rowid #2,Barbara,rowid #3,David,rowid #4,Kevin,rowid #5,Sandra,rowid #6,Sarah,rowid #7,Scott,rowid #8,Martin,rowid #9,Donna,rowid #a,Edward,rowid @acmp
  • 27. This presentation is available in http://db-oriented.com/presentations ©OrenNakdimon PREFIX INDEX COMPRESSION (SINCE ORACLE8I)  Implemented in the leaf block level  May reduce the size of the index  Today’s optimal prefix length may be suboptimal tomorrow  All the index blocks are compressed the same way
  • 28. This presentation is available in http://db-oriented.com/presentations ©OrenNakdimon ADVANCED INDEX COMPRESSION  Same mechanism, but:  Each block may be compressed or not  Each block may have different number of columns in the prefix table  And it’s automatic
  • 29. THANK YOU Oren Nakdimon www.db-oriented.com  [email protected]  +972-54-4393763 @DBoriented © Oren Nakdimon