v$sql and v$sqlarea [message #59956] |
Mon, 05 January 2004 23:23 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Sam
Messages: 255 Registered: April 2000
|
Senior Member |
|
|
why there is a diff when i select count(*) from v$sql and v$sqlarea and also pls let me know where can we use these views for tuning purposes.
thanx in advance
|
|
|
Re: v$sql and v$sqlarea [message #59960 is a reply to message #59956] |
Tue, 06 January 2004 01:31 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Frank Naude
Messages: 4590 Registered: April 1998
|
Senior Member |
|
|
Hi,
V$SQL lists statistics on shared SQL area without the GROUP BY clause and contains one row for each child of the original SQL text entered.
V$SQLAREA lists statistics on shared SQL area and contains one row per SQL string. It provides statistics on SQL statements that are in memory, parsed, and ready for execution.
SELECT COUNT( DISTINCT sql_id ) FROM v$sql;
... should return the same number of rows as
SELECT COUNT(*) FROM v$sqlarea;
Best regards.
Frank
|
|
|
Re: v$sql and v$sqlarea [message #59966 is a reply to message #59956] |
Tue, 06 January 2004 04:53 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) |
Thiru
Messages: 1089 Registered: May 2002
|
Senior Member |
|
|
In addition to what Frank said, queries on v$sql is usually faster than v$sqlarea becos v$sqlarea is constructed from a summary(lots of sum and group by) of all the statistics. Both of them are based on x$kglcursor.
-Thiru
|
|
|