472,789 Members | 1,363 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,789 software developers and data experts.

index statistics

Hello,

is there any way (v$-view) to get informaion about how often an index hast been
used since of starting the Database?

Thanks for help
Heiko
Jul 19 '05 #1
6 5669
Hy!

Try:
select * from all_indexes

Adios
"Heiko" <he***@technologie-management.net> schrieb im Newsbeitrag
news:7b**************************@posting.google.c om...
Hello,

is there any way (v$-view) to get informaion about how often an index hast been used since of starting the Database?

Thanks for help
Heiko

Jul 19 '05 #2
Hi,

You have to monitor the index using
"alter index <index_name> monitoring usage;" and see the
V$object_usage view.

Read the example below and look for "used" column. If the index was
used
the column contains "YES".

In my first query, I used ename column in my where clause which is not
part of index but in second one, I used empno column which is part of
index.
SQL> conn scott/tiger;
Connected.
SQL> select * from tab;

TNAME TABTYPE CLUSTERID
------------------------------ ------- ----------
BONUS TABLE
DEPT TABLE
EMP TABLE
SALGRADE TABLE

SQL>
SQL>
SQL>
SQL>
SQL> select table_name,index_name from user_indexes;

TABLE_NAME INDEX_NAME
------------------------------ ------------------------------
DEPT PK_DEPT
EMP PK_EMP

SQL> select * from v$object_usage;

no rows selected

SQL> alter index PK_EMP monitoring usage;

Index altered.

SQL> select * from emp where ename='SCOTT';

EMPNO ENAME JOB MGR HIREDATE SAL
COMM DEPTNO
---------- ---------- --------- ---------- --------- ----------
---------- ----------
7788 SCOTT ANALYST 7566 19-APR-87 3000
20

SQL> select * from v$object_usage;

INDEX_NAME TABLE_NAME MON USE
START_MONITORING END_MONITORING
------------------------------ ------------------------------ --- ---
------------------- ----------
PK_EMP EMP YES NO
04/28/2004 19:43:42

SQL> select * from emp where empno = 7788;

EMPNO ENAME JOB MGR HIREDATE SAL
COMM DEPTNO
---------- ---------- --------- ---------- --------- ----------
---------- ----------
7788 SCOTT ANALYST 7566 19-APR-87 3000
20

SQL> select * from v$object_usage;

INDEX_NAME TABLE_NAME MON USE
START_MONITORING END_MONITORING
------------------------------ ------------------------------ --- ---
------------------- ----------
PK_EMP EMP YES YES
04/28/2004 19:43:42

Rgds
Dhana
"Putz Ronald" <rp***@etm-ag.com> wrote in message news:<10***************@newsmaster-03.atnet.at>...
Hy!

Try:
select * from all_indexes

Adios
"Heiko" <he***@technologie-management.net> schrieb im Newsbeitrag
news:7b**************************@posting.google.c om...
Hello,

is there any way (v$-view) to get informaion about how often an index hast

been
used since of starting the Database?

Thanks for help
Heiko

Jul 19 '05 #3
Index monitoring is only going to work if your version is at least 9i,
if I remember well.

Daniel
Jul 19 '05 #4
Hi,

Yap, this will work only in 9i database.

Rgds,
Dhana

da*************@hotmail.com (Daniel Roy) wrote in message news:<37***********************@posting.google.com >...
Index monitoring is only going to work if your version is at least 9i,
if I remember well.

Daniel

Jul 19 '05 #5
da*************@hotmail.com (Daniel Roy) wrote in message news:<37***********************@posting.google.com >...
Index monitoring is only going to work if your version is at least 9i,
if I remember well.

Daniel


Hello,
thanks for help!
Yes we use Oracle 9i.
Now we can look which index has already been used, but not, how often.
Is ther any way to get this information too.

thanks Heiko
Jul 19 '05 #6
> > Index monitoring is only going to work if your version is at least 9i,
if I remember well.

Daniel


Hello,
thanks for help!
Yes we use Oracle 9i.
Now we can look which index has already been used, but not, how often.
Is ther any way to get this information too.

thanks Heiko


To get a "ballpark" idea of how often an index is used, I'd
periodically take a look at the contents of the shared pool
during/after periods of high activity (hint for you: column
OBJECT_NAME of dynamic view V$SQL_PLAN).

HTH

Daniel
Jul 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Anita | last post by:
I have just tested 3 queries using QA. The complete test information : ------ CREATE TABLE agls1 ( fyear char(4) NULL , fprefix char(3) NULL , fvcno char(20) NULL , fdate datetime NULL ,...
0
by: neo | last post by:
Hi, On SQL2k with SP3, I wtote a script to change data type for a column in several tables. eq. alter table CorrectionEQDiv Alter Column qSrc int not null I'm getting an error saying "ALTER...
1
by: Gregory.Spencer | last post by:
Hi there, Using PHPMyAdmin and it is very usefully reporting problems with my MySQL DB. "PRIMARY and INDEX keys should not both be set for column `column_name`" and
25
by: sql_server_2000_user | last post by:
Hi, I have a table with about 305 million rows, and a composite primary key that consists of an ascending int and an ascending varchar(18), which is typically of length 13. Even if all the keys...
8
by: Andr? Queiroz | last post by:
Hi, I have a table with 10M records and col A has a index created on it. The data on that table has the same value for col A on all 10M records. After that I insert diferent values for that column...
14
by: Sean C. | last post by:
Helpful folks, Most of my previous experience with DB2 was on s390 mainframe systems and the optimizer on this platform always seemed very predictable and consistent. Since moving to a WinNT/UDB...
0
by: Guru | last post by:
Hi All i used this statement to create a temporary table index. Create index session.indname on session.tablename collect statistics. it throws an error saying that SQL0526N The...
3
by: dunleav1 | last post by:
I am trying to write a sql script to estimate size and count of rows of all tables and indexes within a schema. Here's what I have so far but need a little help. #$1 is database name and $2 is...
6
by: Ian Ribas | last post by:
Hello, This is probably a common problem, but I couldn't really find a direct answer in the archives (or maybe just couldn't find one that satisfied me ;-). I created an index specifically to...
122
by: C.L. | last post by:
I was looking for a function or method that would return the index to the first matching element in a list. Coming from a C++ STL background, I thought it might be called "find". My first stop was...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Using CodiumAI's pr-agent is simple and powerful. Follow these steps: 1. Install CodiumAI CLI: Ensure Node.js is installed, then run 'npm install -g codiumai' in the terminal. 2. Connect to...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.