-
Notifications
You must be signed in to change notification settings - Fork 303
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sqlmemh.sql sql_id or hash_value #40
Comments
Hello, I recall changing the sqlmem.sql to use SQL_ID (I wrote it many years ago before 10g adn SQL_IDs) and sqlmemh.sql is the same thing, but takes a hash value as an argument. (Pull the latest code if it's different for you and feel free to submit additions to help.sql :-) |
Aalso I see that the PROMPT code says "SQL_ID" in both scripts, feel free to send a PR for that too! |
OK, done. Fell totally down a rabbit hole in that on the version of the database I am working on (19.3) v$sql_shared_memory is broken, eg
|
Yep the v$sql_shared_memory / x$ksmhp only work when it's using the "fixed index" based access into a specific heap descriptor address (it doesn't walk through all the heaps that it can find and dump them). So the USE_NL hint (and in later versions the USE_NL_WITH_INDEX) in the v$sql_shared_memory view make optimizer come up with a NL plan that gets interesting heap addresses from x$kglcursor and then uses a nested loop to look up each heap descriptor with its exact memory address using the x$ksmhp "heap dump" x$view...
|
Help and code don't match up, the help says it's using sql_id, but it's actually using hash_value.
prompt Show shared pool memory usage of SQL statement with SQL_ID &1
FROM
v$sql
WHERE
hash_value = &1
/
(confused me for about 15 seconds, i'd fix it and do a Pull Request, but I don't know which it should be)
The text was updated successfully, but these errors were encountered: