SlideShare a Scribd company logo
1 of 4
Invisible Indexes
Bu yazimda 11g ile gelen yeni ozellik “"invisible index" ler uzerinde dayanacagam. Eger biz
Index I invisibleye chekdiyimzde optimizer o index yoxmush kimi davranacaqdir. Diger
terefden gelen insertlerde index update olmaya devam edecekdir. Yeni indexsi yeniden
visible etdiyimizde indexsi rebuild etmeye gerek qalmayacaqdir.
Bunu istifade ede bilmemiz uchun COMPATIBLE parametresi en az 11.0.0.0.0 olmalidir.
Bele olmasa o zmana ashagdaki xetani alacaqsiniz.
ORA-00406: COMPATIBLE parametresi 11.0.0.0.0 ve ya daha boyuk olmalıdır
Oracle 11g Databaselerde optimizer_use_invisible_indexes parametresi default olarak FALSE
gelir.Bu parameteni TRUE etdiyimizde optimizer invisible indexleri istifade edmeyecekdir.
SQL> show parameter optimizer_use_invisible_indexes
NAME TYPE VALUE
------------------------------------ ----------optimizer_use_invisible_indexes boolean FALSE

Misal uchun bir table ve index yaradaraq invisible index testi heyata kechirek.
SQL> create table deneme as select * from dba_objects;
Table created.

SQL> CREATE INDEX indx_deneme_owner ON DENEME(OWNER);
Index created.
SQL> set autotrace traceonly
SQL> select * from deneme where owner='ANAR';
Execution Plan
--------------------------------------------------------| Id | Operation | Name |
--------------------------------------------------------| 0 | SELECT STATEMENT | |
| 1 | TABLE ACCESS BY INDEX ROWID| DENEME |
|* 2 | INDEX RANGE SCAN | INDX_DENEME_OWNER |
--------------------------------------------------------SQL> set autotrace off;
Bu sorguda optimizer index istifade olundu.
Indi indexsimizi invisibla chekerek tekrar execution plani inceleyek.
Optimizer indexi gormezden gelerek table access full scan getmesini gozleyirik.
SQL> alter index indx_deneme_owner invisible;
Index altered.
SQL> set autotrace traceonly
SQL> select * from deneme where owner='ANAR';
Execution Plan
-----------------------------------| Id | Operation | Name |
-----------------------------------| 0 | SELECT STATEMENT | |
|* 1 | TABLE ACCESS FULL| DENEME |
-----------------------------------SQL> set autotrace off
Gorduyumuz kimi optimizer indexi gormedi ve DENEME tablesine full access getdi.
Bu zaman bele bir sual ortaya chixir. Bir index invisible-dirsa update olunurmu? Gozel sual
 Test uchun analiz tarixi ve setir sayisini inceleyek.
SQL> select num_rows,last_analyzed from dba_indexes where index_name
='INDX_DENEME_OWNER';
NUM_ROWS LAST_ANAL
---------- --------79051 12.03.2012 10:39:27
Analiz tarixi indexsin yaradilma tarihi
BU deqiqe indexsimiz invisibledir. Tablenin statistikasini alsqa bu zaman indexsimizin
statistikasida toplanacaqdir.
SQL> exec
dbms_stats.gather_table_stats(ownname=>'SYS',tabname=>'DENEME',cascade=
>true);
PL/SQL procedure successfully completed.
SQL> select num_rows,last_analyzed from dba_indexes where index_name
='INDX_DENEME_OWNER';
NUM_ROWS LAST_ANAL
---------- --------79051 12.03.2012 10:41:03
Yeniden analiz tarixine baxiriq ve bu anin tarixi oldugunu goruruk.
Demeli index invisible olsada update olur.
Birde tabeleye insert edek tekrar baxaq.
SQL> insert into deneme select * from dba_objects;
79052 rows created.
SQL> commit;
Commit complete.
SQL> exec dbms_stats.gather_index_stats('SYS','INDX_DENEME_OWNER');
PL/SQL procedure successfully completed.
SQL> select num_rows,last_analyzed from dba_indexes where
index_name ='INDX_DENEME_OWNER';
NUM_ROWS LAST_ANAL
---------- --------158103 12.03.2012 10:43:15
Burdan goruruk ki num_rows columumuzda artdi.
Indi tekrar visableye chekek.
SQL> alter index indx_deneme_owner visible;
Index altered.
Indi Indesimiz istifade edile bilir ve herhansi bir index rebuild ishlemine ehtiyac yoxdur.
SQL> set autotrace traceonly
SQL> select * from deneme where owner='ANAR';
Execution Plan
--------------------------------------------------------| Id | Operation | Name |
--------------------------------------------------------| 0 | SELECT STATEMENT | |
| 1 | TABLE ACCESS BY INDEX ROWID| DENEME |
|* 2 | INDEX RANGE SCAN | INDX_DENEME_OWNER |
--------------------------------------------------------SQL> set autotrace off

Birde optimizer_use_invisible_indexes parametresini test edek.
Ilk once indexsi visibleye chekek ardindan parametreni true edek.
SQL> alter index indx_deneme_owner invisible;
Index altered.
SQL> set autotrace traceonly
SQL> select * from deneme where owner='ANAR';
-----------------------------------| Id | Operation | Name |
-----------------------------------| 0 | SELECT STATEMENT | |
|* 1 | TABLE ACCESS FULL| DENEME |
-----------------------------------Parametreni TRUEya chekdiyimizde artiq optimizer Invisible indexleri istifade etmeyecek.
SQL> alter session set optimizer_use_invisible_indexes=TRUE;
Session altered.
SQL> select * from deneme where owner='ANAR';
Execution Plan
--------------------------------------------------------| Id | Operation | Name |
--------------------------------------------------------| 0 | SELECT STATEMENT | |
| 1 | TABLE ACCESS BY INDEX ROWID| DENEME |
|* 2 | INDEX RANGE SCAN | INDX_DENEME_OWNER |
-------------------------

More Related Content

What's hot

Database development coding standards
Database development coding standardsDatabase development coding standards
Database development coding standards
Alessandro Baratella
 
Web app development_my_sql_09
Web app development_my_sql_09Web app development_my_sql_09
Web app development_my_sql_09
Hassen Poreya
 
Diva10
Diva10Diva10
Diva10
diva23
 
Sql having clause
Sql having clauseSql having clause
Sql having clause
Vivek Singh
 

What's hot (19)

Procedures/functions of rdbms
Procedures/functions of rdbmsProcedures/functions of rdbms
Procedures/functions of rdbms
 
Introduction to triggers
Introduction to triggersIntroduction to triggers
Introduction to triggers
 
PL/SQL TRIGGERS
PL/SQL TRIGGERSPL/SQL TRIGGERS
PL/SQL TRIGGERS
 
Sql triggers
Sql triggersSql triggers
Sql triggers
 
Performance tuning
Performance tuningPerformance tuning
Performance tuning
 
Using triggers in my sql database
Using triggers in my sql databaseUsing triggers in my sql database
Using triggers in my sql database
 
Oracle Database Trigger
Oracle Database TriggerOracle Database Trigger
Oracle Database Trigger
 
MySql Triggers Tutorial - The Webs Academy
MySql Triggers Tutorial - The Webs AcademyMySql Triggers Tutorial - The Webs Academy
MySql Triggers Tutorial - The Webs Academy
 
Stored procedure
Stored procedureStored procedure
Stored procedure
 
PHP with MySQL
PHP with MySQLPHP with MySQL
PHP with MySQL
 
Database development coding standards
Database development coding standardsDatabase development coding standards
Database development coding standards
 
Web app development_my_sql_09
Web app development_my_sql_09Web app development_my_sql_09
Web app development_my_sql_09
 
Trigger
TriggerTrigger
Trigger
 
Sql Functions And Procedures
Sql Functions And ProceduresSql Functions And Procedures
Sql Functions And Procedures
 
Diva10
Diva10Diva10
Diva10
 
TSQL Coding Guidelines
TSQL Coding GuidelinesTSQL Coding Guidelines
TSQL Coding Guidelines
 
Sql having clause
Sql having clauseSql having clause
Sql having clause
 
Sub query_SQL
Sub query_SQLSub query_SQL
Sub query_SQL
 
Meet the CBO in Version 11g
Meet the CBO in Version 11gMeet the CBO in Version 11g
Meet the CBO in Version 11g
 

Viewers also liked

Pagnilayan aralin 1 KATANGIANG PISIKAL NG ASYA
Pagnilayan aralin 1 KATANGIANG PISIKAL NG ASYAPagnilayan aralin 1 KATANGIANG PISIKAL NG ASYA
Pagnilayan aralin 1 KATANGIANG PISIKAL NG ASYA
Olhen Rence Duque
 
Divine nine alpha phi alpha
Divine nine alpha phi alphaDivine nine alpha phi alpha
Divine nine alpha phi alpha
NAACPConnect
 
"Certeza", Miguel Torga
"Certeza", Miguel Torga"Certeza", Miguel Torga
"Certeza", Miguel Torga
elcedin
 
Projeto Monavie Prelancamento
Projeto Monavie PrelancamentoProjeto Monavie Prelancamento
Projeto Monavie Prelancamento
Lester Izaac
 
iOS-01-Основы Objective-C
iOS-01-Основы Objective-CiOS-01-Основы Objective-C
iOS-01-Основы Objective-C
Noveo
 
Guiacomerciossi Sv5%5b1%5d.18
Guiacomerciossi Sv5%5b1%5d.18Guiacomerciossi Sv5%5b1%5d.18
Guiacomerciossi Sv5%5b1%5d.18
guest790c2
 
Cheats to get likes on keek
Cheats to get likes on keekCheats to get likes on keek
Cheats to get likes on keek
hogh895
 
Programação etapa Regional Leste-Norte da JESC (15-17 anos)
Programação etapa Regional Leste-Norte da JESC (15-17 anos)Programação etapa Regional Leste-Norte da JESC (15-17 anos)
Programação etapa Regional Leste-Norte da JESC (15-17 anos)
esportealtovale
 

Viewers also liked (20)

Pagnilayan aralin 1 KATANGIANG PISIKAL NG ASYA
Pagnilayan aralin 1 KATANGIANG PISIKAL NG ASYAPagnilayan aralin 1 KATANGIANG PISIKAL NG ASYA
Pagnilayan aralin 1 KATANGIANG PISIKAL NG ASYA
 
Seminar PPT - ICT Training - V.Balafas
Seminar PPT - ICT Training - V.BalafasSeminar PPT - ICT Training - V.Balafas
Seminar PPT - ICT Training - V.Balafas
 
UD. SCG. T4. Sistemas de coste completo
UD. SCG. T4. Sistemas de coste completoUD. SCG. T4. Sistemas de coste completo
UD. SCG. T4. Sistemas de coste completo
 
UD. SCG. T7. Sistema de coste completo corregido o normalizado
UD. SCG. T7. Sistema de coste completo corregido o normalizadoUD. SCG. T7. Sistema de coste completo corregido o normalizado
UD. SCG. T7. Sistema de coste completo corregido o normalizado
 
Acte bibliot. 1r trim
Acte bibliot. 1r trimActe bibliot. 1r trim
Acte bibliot. 1r trim
 
Divine nine alpha phi alpha
Divine nine alpha phi alphaDivine nine alpha phi alpha
Divine nine alpha phi alpha
 
Cambio ClimáTico
Cambio ClimáTicoCambio ClimáTico
Cambio ClimáTico
 
"Certeza", Miguel Torga
"Certeza", Miguel Torga"Certeza", Miguel Torga
"Certeza", Miguel Torga
 
Projeto Monavie Prelancamento
Projeto Monavie PrelancamentoProjeto Monavie Prelancamento
Projeto Monavie Prelancamento
 
Personal Branding & Public Speaking: come comunicare chi sei e quanto vali?
Personal Branding & Public Speaking: come comunicare chi sei e quanto vali?Personal Branding & Public Speaking: come comunicare chi sei e quanto vali?
Personal Branding & Public Speaking: come comunicare chi sei e quanto vali?
 
Tunisian factory tablet
Tunisian factory tabletTunisian factory tablet
Tunisian factory tablet
 
Semana Santa(M 7)
Semana Santa(M 7)Semana Santa(M 7)
Semana Santa(M 7)
 
Projeto ForestWatchers (por Álvaro Fazenda)
Projeto ForestWatchers (por Álvaro Fazenda)Projeto ForestWatchers (por Álvaro Fazenda)
Projeto ForestWatchers (por Álvaro Fazenda)
 
iOS-01-Основы Objective-C
iOS-01-Основы Objective-CiOS-01-Основы Objective-C
iOS-01-Основы Objective-C
 
Guiacomerciossi Sv5%5b1%5d.18
Guiacomerciossi Sv5%5b1%5d.18Guiacomerciossi Sv5%5b1%5d.18
Guiacomerciossi Sv5%5b1%5d.18
 
Cheats to get likes on keek
Cheats to get likes on keekCheats to get likes on keek
Cheats to get likes on keek
 
Bhutanese
BhutaneseBhutanese
Bhutanese
 
Programação etapa Regional Leste-Norte da JESC (15-17 anos)
Programação etapa Regional Leste-Norte da JESC (15-17 anos)Programação etapa Regional Leste-Norte da JESC (15-17 anos)
Programação etapa Regional Leste-Norte da JESC (15-17 anos)
 
Proyecto final de infromativca tiban ma. de los an geles y yolanda pinto
Proyecto final de infromativca tiban ma. de los an geles y yolanda pintoProyecto final de infromativca tiban ma. de los an geles y yolanda pinto
Proyecto final de infromativca tiban ma. de los an geles y yolanda pinto
 
Guarantee scheme experience at aBi Finance Limited in Uganda
Guarantee scheme experience at aBi Finance Limited in Uganda Guarantee scheme experience at aBi Finance Limited in Uganda
Guarantee scheme experience at aBi Finance Limited in Uganda
 

Similar to Oracle 11g Invisible Indexes

Twp Upgrading 10g To 11g What To Expect From Optimizer
Twp Upgrading 10g To 11g What To Expect From OptimizerTwp Upgrading 10g To 11g What To Expect From Optimizer
Twp Upgrading 10g To 11g What To Expect From Optimizer
qiw
 
Subqueries views stored procedures_triggers_transactions
Subqueries views stored procedures_triggers_transactionsSubqueries views stored procedures_triggers_transactions
Subqueries views stored procedures_triggers_transactions
maxpane
 
Sydney Oracle Meetup - indexes
Sydney Oracle Meetup - indexesSydney Oracle Meetup - indexes
Sydney Oracle Meetup - indexes
paulguerin
 

Similar to Oracle 11g Invisible Indexes (20)

12c SQL Plan Directives
12c SQL Plan Directives12c SQL Plan Directives
12c SQL Plan Directives
 
Twp Upgrading 10g To 11g What To Expect From Optimizer
Twp Upgrading 10g To 11g What To Expect From OptimizerTwp Upgrading 10g To 11g What To Expect From Optimizer
Twp Upgrading 10g To 11g What To Expect From Optimizer
 
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
Oracle Database 12c - The Best Oracle Database 12c Tuning Features for Develo...
 
Oracle SQL Tuning
Oracle SQL TuningOracle SQL Tuning
Oracle SQL Tuning
 
Data Redaction - OTN TOUR LA 2015
Data Redaction - OTN TOUR LA 2015 Data Redaction - OTN TOUR LA 2015
Data Redaction - OTN TOUR LA 2015
 
Useful PL/SQL Supplied Packages
Useful PL/SQL Supplied PackagesUseful PL/SQL Supplied Packages
Useful PL/SQL Supplied Packages
 
Oracle Data Redaction
Oracle Data RedactionOracle Data Redaction
Oracle Data Redaction
 
Correlated update vs merge
Correlated update vs mergeCorrelated update vs merge
Correlated update vs merge
 
Subqueries views stored procedures_triggers_transactions
Subqueries views stored procedures_triggers_transactionsSubqueries views stored procedures_triggers_transactions
Subqueries views stored procedures_triggers_transactions
 
Sydney Oracle Meetup - indexes
Sydney Oracle Meetup - indexesSydney Oracle Meetup - indexes
Sydney Oracle Meetup - indexes
 
SQL/MX 3.6 Select for update feature
SQL/MX 3.6 Select for update featureSQL/MX 3.6 Select for update feature
SQL/MX 3.6 Select for update feature
 
Five_Things_You_Might_Not_Know_About_Oracle_Database_v2.pptx
Five_Things_You_Might_Not_Know_About_Oracle_Database_v2.pptxFive_Things_You_Might_Not_Know_About_Oracle_Database_v2.pptx
Five_Things_You_Might_Not_Know_About_Oracle_Database_v2.pptx
 
Checking clustering factor to detect row migration
Checking clustering factor to detect row migrationChecking clustering factor to detect row migration
Checking clustering factor to detect row migration
 
Oracle-Whitepaper-Optimizer-with-Oracle-Database-12c.pdf
Oracle-Whitepaper-Optimizer-with-Oracle-Database-12c.pdfOracle-Whitepaper-Optimizer-with-Oracle-Database-12c.pdf
Oracle-Whitepaper-Optimizer-with-Oracle-Database-12c.pdf
 
It6312 dbms lab-ex2
It6312 dbms lab-ex2It6312 dbms lab-ex2
It6312 dbms lab-ex2
 
Cbo100053
Cbo100053Cbo100053
Cbo100053
 
Assignment#05
Assignment#05Assignment#05
Assignment#05
 
PHP tips by a MYSQL DBA
PHP tips by a MYSQL DBAPHP tips by a MYSQL DBA
PHP tips by a MYSQL DBA
 
Oracle vs. SQL Server- War of the Indices
Oracle vs. SQL Server- War of the IndicesOracle vs. SQL Server- War of the Indices
Oracle vs. SQL Server- War of the Indices
 
SQL Macros - Game Changing Feature for SQL Developers?
SQL Macros - Game Changing Feature for SQL Developers?SQL Macros - Game Changing Feature for SQL Developers?
SQL Macros - Game Changing Feature for SQL Developers?
 

More from Anar Godjaev

More from Anar Godjaev (20)

Oracle GoldenGate
Oracle GoldenGateOracle GoldenGate
Oracle GoldenGate
 
Asm disk group migration from
Asm disk group migration from Asm disk group migration from
Asm disk group migration from
 
How to protect your sensitive data using oracle database vault / Creating and...
How to protect your sensitive data using oracle database vault / Creating and...How to protect your sensitive data using oracle database vault / Creating and...
How to protect your sensitive data using oracle database vault / Creating and...
 
how to protect your sensitive data using oracle database vault
how to protect your sensitive data using oracle database vaulthow to protect your sensitive data using oracle database vault
how to protect your sensitive data using oracle database vault
 
Database Vault / Verinin Güvenliği
Database Vault /  Verinin GüvenliğiDatabase Vault /  Verinin Güvenliği
Database Vault / Verinin Güvenliği
 
Oracle Golden Gate
Oracle Golden GateOracle Golden Gate
Oracle Golden Gate
 
Oracle 10g Database Server Kurulum
Oracle 10g Database Server KurulumOracle 10g Database Server Kurulum
Oracle 10g Database Server Kurulum
 
DataPump ile Single Parititon Export
DataPump ile Single Parititon ExportDataPump ile Single Parititon Export
DataPump ile Single Parititon Export
 
Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇Redologlar ve Yöneti̇mi̇
Redologlar ve Yöneti̇mi̇
 
Contraints
ContraintsContraints
Contraints
 
Oracle SQL
Oracle SQLOracle SQL
Oracle SQL
 
Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇Veri̇tabani ve Kullanici Yöneti̇mi̇
Veri̇tabani ve Kullanici Yöneti̇mi̇
 
Instance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını IncelemeInstance ve Media Bozukluklarını Inceleme
Instance ve Media Bozukluklarını Inceleme
 
Conditional Control
Conditional ControlConditional Control
Conditional Control
 
PL/SQL Blocks
PL/SQL BlocksPL/SQL Blocks
PL/SQL Blocks
 
Wait Interface
Wait InterfaceWait Interface
Wait Interface
 
Audit Mekani̇zmasi
Audit Mekani̇zmasiAudit Mekani̇zmasi
Audit Mekani̇zmasi
 
Tuning SGA
Tuning SGATuning SGA
Tuning SGA
 
Parallel Server
Parallel ServerParallel Server
Parallel Server
 
Table Partitions
Table PartitionsTable Partitions
Table Partitions
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 

Oracle 11g Invisible Indexes

  • 1. Invisible Indexes Bu yazimda 11g ile gelen yeni ozellik “"invisible index" ler uzerinde dayanacagam. Eger biz Index I invisibleye chekdiyimzde optimizer o index yoxmush kimi davranacaqdir. Diger terefden gelen insertlerde index update olmaya devam edecekdir. Yeni indexsi yeniden visible etdiyimizde indexsi rebuild etmeye gerek qalmayacaqdir. Bunu istifade ede bilmemiz uchun COMPATIBLE parametresi en az 11.0.0.0.0 olmalidir. Bele olmasa o zmana ashagdaki xetani alacaqsiniz. ORA-00406: COMPATIBLE parametresi 11.0.0.0.0 ve ya daha boyuk olmalıdır Oracle 11g Databaselerde optimizer_use_invisible_indexes parametresi default olarak FALSE gelir.Bu parameteni TRUE etdiyimizde optimizer invisible indexleri istifade edmeyecekdir. SQL> show parameter optimizer_use_invisible_indexes NAME TYPE VALUE ------------------------------------ ----------optimizer_use_invisible_indexes boolean FALSE Misal uchun bir table ve index yaradaraq invisible index testi heyata kechirek. SQL> create table deneme as select * from dba_objects; Table created. SQL> CREATE INDEX indx_deneme_owner ON DENEME(OWNER); Index created. SQL> set autotrace traceonly SQL> select * from deneme where owner='ANAR'; Execution Plan --------------------------------------------------------| Id | Operation | Name | --------------------------------------------------------| 0 | SELECT STATEMENT | | | 1 | TABLE ACCESS BY INDEX ROWID| DENEME | |* 2 | INDEX RANGE SCAN | INDX_DENEME_OWNER | --------------------------------------------------------SQL> set autotrace off; Bu sorguda optimizer index istifade olundu. Indi indexsimizi invisibla chekerek tekrar execution plani inceleyek.
  • 2. Optimizer indexi gormezden gelerek table access full scan getmesini gozleyirik. SQL> alter index indx_deneme_owner invisible; Index altered. SQL> set autotrace traceonly SQL> select * from deneme where owner='ANAR'; Execution Plan -----------------------------------| Id | Operation | Name | -----------------------------------| 0 | SELECT STATEMENT | | |* 1 | TABLE ACCESS FULL| DENEME | -----------------------------------SQL> set autotrace off Gorduyumuz kimi optimizer indexi gormedi ve DENEME tablesine full access getdi. Bu zaman bele bir sual ortaya chixir. Bir index invisible-dirsa update olunurmu? Gozel sual  Test uchun analiz tarixi ve setir sayisini inceleyek. SQL> select num_rows,last_analyzed from dba_indexes where index_name ='INDX_DENEME_OWNER'; NUM_ROWS LAST_ANAL ---------- --------79051 12.03.2012 10:39:27 Analiz tarixi indexsin yaradilma tarihi BU deqiqe indexsimiz invisibledir. Tablenin statistikasini alsqa bu zaman indexsimizin statistikasida toplanacaqdir. SQL> exec dbms_stats.gather_table_stats(ownname=>'SYS',tabname=>'DENEME',cascade= >true); PL/SQL procedure successfully completed. SQL> select num_rows,last_analyzed from dba_indexes where index_name ='INDX_DENEME_OWNER'; NUM_ROWS LAST_ANAL ---------- --------79051 12.03.2012 10:41:03
  • 3. Yeniden analiz tarixine baxiriq ve bu anin tarixi oldugunu goruruk. Demeli index invisible olsada update olur. Birde tabeleye insert edek tekrar baxaq. SQL> insert into deneme select * from dba_objects; 79052 rows created. SQL> commit; Commit complete. SQL> exec dbms_stats.gather_index_stats('SYS','INDX_DENEME_OWNER'); PL/SQL procedure successfully completed. SQL> select num_rows,last_analyzed from dba_indexes where index_name ='INDX_DENEME_OWNER'; NUM_ROWS LAST_ANAL ---------- --------158103 12.03.2012 10:43:15 Burdan goruruk ki num_rows columumuzda artdi. Indi tekrar visableye chekek. SQL> alter index indx_deneme_owner visible; Index altered. Indi Indesimiz istifade edile bilir ve herhansi bir index rebuild ishlemine ehtiyac yoxdur. SQL> set autotrace traceonly SQL> select * from deneme where owner='ANAR'; Execution Plan --------------------------------------------------------| Id | Operation | Name | --------------------------------------------------------| 0 | SELECT STATEMENT | | | 1 | TABLE ACCESS BY INDEX ROWID| DENEME | |* 2 | INDEX RANGE SCAN | INDX_DENEME_OWNER | --------------------------------------------------------SQL> set autotrace off Birde optimizer_use_invisible_indexes parametresini test edek. Ilk once indexsi visibleye chekek ardindan parametreni true edek.
  • 4. SQL> alter index indx_deneme_owner invisible; Index altered. SQL> set autotrace traceonly SQL> select * from deneme where owner='ANAR'; -----------------------------------| Id | Operation | Name | -----------------------------------| 0 | SELECT STATEMENT | | |* 1 | TABLE ACCESS FULL| DENEME | -----------------------------------Parametreni TRUEya chekdiyimizde artiq optimizer Invisible indexleri istifade etmeyecek. SQL> alter session set optimizer_use_invisible_indexes=TRUE; Session altered. SQL> select * from deneme where owner='ANAR'; Execution Plan --------------------------------------------------------| Id | Operation | Name | --------------------------------------------------------| 0 | SELECT STATEMENT | | | 1 | TABLE ACCESS BY INDEX ROWID| DENEME | |* 2 | INDEX RANGE SCAN | INDX_DENEME_OWNER | -------------------------