473,811 Members | 2,946 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 5738
Hy!

Try:
select * from all_indexes

Adios
"Heiko" <he***@technolo gie-management.net> schrieb im Newsbeitrag
news:7b******** *************** ***@posting.goo gle.com...
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,inde x_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_MONITORIN G 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_MONITORIN G 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******* ********@newsma ster-03.atnet.at>...
Hy!

Try:
select * from all_indexes

Adios
"Heiko" <he***@technolo gie-management.net> schrieb im Newsbeitrag
news:7b******** *************** ***@posting.goo gle.com...
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.googl e.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.googl e.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
4457
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 , fid char(15) NULL ,
0
498
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 TABLE ALTER COLUMN qSrc failed because one or more objects access this column." So I looked at the table and found there are some "STATISTICS" on the
1
3196
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
4928
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 used the full 18 characters of the varchar, it seems to me each key should be 22 bytes, so the index should be roughly 6.4GB. However, the size of the index as shown in EM is about 24GB, and this is slowing everything down considerably. Does...
8
4840
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 but my queries do not use the index I created for that column. Is there any way I can force the usage of the index or to ommit a value on the index creation, like 0 (zeroes) or spaces? Thanks in advance, André Queiroz
14
5426
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 7.2 environment, the choices the optimizer makes often seem flaky. But this last example really floored me. I was hoping someone could explain why I get worse response time when the optimizer uses two indexes, than when it uses one. Some context:
0
1480
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 requested function does not apply to declared temporary
3
24205
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 schema name db2 connect to $1 db2 select tabname,t1.fpages * t2.pagesize as bytes from syscat.tables t1, syscat.tablespaces t2 where t1.tabschema='$2' and t1.tbspace=t2.tbspace
6
1578
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 help a query and the optimizer does not use it. It prefers an older index that has one less column, but that yields much poorer performance. The query get the smallest date in a period, for some criteria. The one table used in the query has...
122
5546
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 the Sequence Types page of the Library Reference (http://docs.python.org/lib/typesseq.html); it wasn't there. A search of the Library Reference's index seemed to confirm that the function did not exist. A little later I realized it might be called...
0
9607
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10663
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10401
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10416
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9217
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7676
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5567
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5704
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4357
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.